HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


[Answered: YES!] Alternate Row Color For OCF?

Login / Search

 [ Join | More ]
 Add topic 
Posted
Item has a rating of 5 (Liked by BobSLiked by FletchLiked by Jean)  
Rating:
#89862 (In Topic #18211)
Avatar

Community saint

ocPortal 9; inquiry not a bug or problem

Greetings,

I have a simple stylistic question. I am hoping that maybe one of the great master themers *cough*Jean*cough* could answer this one so Chris can go out and enjoy a break from answering my massive amounts of questions. But if Chris just can't help himself and wants to jump in, I understand and am appreciative lol.

Anyway, I want to know if we can change the colors of the OCF forum index for the ros instead of columns? IE, have alternate row colors instead of different column colors so say even # rows could be one color, and odd # rows another color?

I understand that doing this for rows would be more difficult because unlike columns, there could be many many forums or only one or two. But IF it were possible, it might look better I think.

So is this a possibility? Or should I just find love with column coloring?

BTW - I do love how the forum view page automatically updated the column colors as I was playing around with it, without me even having to save. Talk about immediate preview! Just simply awesome.


Last edit: by mythus

Legends of Nor'Ova: A site powered by ocPortal; home of the Legends of Nor'Ova tabletop RPG wiki and community.

Like ocPortal? Want to thank Chris and gang somehow? Then help out in the chat room! It really needs your help! Just open it in a tab everytime you open your web browser, and when you hear a "ding", check it out!

"Those who want help should first be willing to give help."
Back to the top
 
Posted
Rating:
#89869
Avatar

Community saint

I have yet to install version 9 but I would also prefer alternating row colors over alternating column colors. Perhaps someone can figure out how to do this. It just seems a lengthy list of topics can really benefit from alternate row colors.

Bob

Back to the top
 
Posted
Rating:
#89872
Avatar

Community saint

I agree. Especially being able to color important threads differently in the forum index view, and i always find alternating row colors to be easier to read than alternating column colors, but that could just be me... lol.

Legends of Nor'Ova: A site powered by ocPortal; home of the Legends of Nor'Ova tabletop RPG wiki and community.

Like ocPortal? Want to thank Chris and gang somehow? Then help out in the chat room! It really needs your help! Just open it in a tab everytime you open your web browser, and when you hear a "ding", check it out!

"Those who want help should first be willing to give help."
Back to the top
 
Posted
Rating:
#89875
Avatar

Community saint

Sorry mythus, I cannot be of much help right now, as v9 is also very new to me and I have yet to start working on themes.

I have some familiarity with being able to style columns with the old ocf.css, but a lot has changed with this new version. I like the idea of row styling and will certainly investigate this possibility eventually.

Hopefully someone else can shed more light on this meanwhile!

Cheers,
Jean
Back to the top
 
Posted
Rating:
#89879
Avatar

Community saint

Thanks for the reply Jean,

Yeah, as I continue to dive into OCF.css, I can't find a means to do so. The old css stylings (row1 and row 2 and the like) were changed to ocf_column followed by a number. I suppose that more accurately represents what those things did…

For some reason, I feel like we were able to change row colors in the distant past… But my brain might be lieing to me again…

So short of being able to add new css tags in to color rows… I just don't see a way to do so.

Legends of Nor'Ova: A site powered by ocPortal; home of the Legends of Nor'Ova tabletop RPG wiki and community.

Like ocPortal? Want to thank Chris and gang somehow? Then help out in the chat room! It really needs your help! Just open it in a tab everytime you open your web browser, and when you hear a "ding", check it out!

"Those who want help should first be willing to give help."
Back to the top
 
Posted
Rating:
#89881
Avatar

Community saint

Yeah I did a quick inspection of v9 install and there is no class set to rows so I assume that without php code change it can't be done but then again I really haven't studied tempcode myself so perhaps it could be done in there?
Back to the top
 
Posted
Rating:
#89883
Avatar

Could be done in a template. OCF_FORUM_TOPIC_ROW at a blind guess. Just put class="{$CYCLE,forum_rows,row_even,row_odd}" or similar in there and then reference .row_even and .row_odd in CSS with different colours.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#89885
Avatar

Community saint

I was just testing this out as we speak as I looked up tempcode instructions earlier.  Although I think it needs to be done in ocf_forum_in_grouping.tpl

if you're talking for forum index
Back to the top
 
Posted
Rating:
#89890
Avatar

Community saint

I tried both with no good results.

Duck, every where I tried within ocf_forum_in_grouping either did nothing with the a tag or make a new column with the td tag.

This will definetly be a project to mess around with for a few days lol…

Legends of Nor'Ova: A site powered by ocPortal; home of the Legends of Nor'Ova tabletop RPG wiki and community.

Like ocPortal? Want to thank Chris and gang somehow? Then help out in the chat room! It really needs your help! Just open it in a tab everytime you open your web browser, and when you hear a "ding", check it out!

"Those who want help should first be willing to give help."
Back to the top
 
Posted
Item has a rating of 5 (Liked by FletchLiked by Jean)  
Rating:
#89893
Avatar

Community saint

For forum index here is where the change needs made in ocf_forum_in_grouping.tpl don't forget to clear template cache

Code

<tr class="{$CYCLE,forum_rows,row_even,row_odd}">
    {+START,IF,{$NOT,{$MOBILE}}}
        <td class="ocf_forum_new_post_indicator ocf_column1">
            <img alt="{LANG_NEW_POST_OR_NOT*}" src="{$IMG*,ocf_general/{NEW_POST_OR_NOT*}}" />
        </td>
    {+END}
    <td class="ocf_forum_in_category_forum ocf_column2">
        <a class="field_name" href="{FORUM_URL*}">{+START,FRACTIONAL_EDITABLE,{FORUM_NAME},name,_SEARCH:admin_ocf_forums:type=__ed:id={ID}}{FORUM_NAME*}{+END}</a>

        {+START,IF_NON_EMPTY,{EDIT_URL}}
            <a class="horiz_field_sep associated_link suggested_link" rel="edit" href="{EDIT_URL*}" title="{!EDIT}: {FORUM_NAME*}">{!EDIT}</a>
        {+END}
        {+START,IF_NON_EMPTY,{FORUM_RULES_URL}}
            <a class="horiz_field_sep associated_link suggested_link" target="_blank" onclick="window.faux_open(maintain_theme_in_link('{FORUM_RULES_URL*}'),'','width=600,height=500,status=yes,resizable=yes,scrollbars=yes'); return false;" href="{FORUM_RULES_URL*}" title="{!FORUM_RULES}: {FORUM_NAME*} {!LINK_NEW_WINDOW}">{!FORUM_RULES}</a>
        {+END}
        {+START,IF_NON_EMPTY,{INTRO_QUESTION_URL}}
            <a class="horiz_field_sep associated_link suggested_link" target="_blank" onclick="window.faux_open(maintain_theme_in_link('{INTRO_QUESTION_URL*}'),'','width=600,height=500,status=yes,resizable=yes,scrollbars=yes'); return false;" href="{INTRO_QUESTION_URL*}" title="{!INTRO_QUESTION}: {FORUM_NAME*} {!LINK_NEW_WINDOW}">{!INTRO_QUESTION}</a>
        {+END}

        {+START,IF_NON_EMPTY,{DESCRIPTION}}
            <div class="ocf_forum_description">
                {DESCRIPTION}
            </div>
        {+END}

        {+START,IF_NON_EMPTY,{SUBFORUMS}}
            <div class="ocf_forum_subforums">
                <p><span class="field_name">{!SUBFORUMS}:</span> {SUBFORUMS}</p>
            </div>
        {+END}

        {+START,IF,{$MOBILE}}
            <ul class="horizontal_meta_details associated_details" role="contentinfo">
                <li><span class="field_name">{!COUNT_TOPICS}:</span> {$PREG_REPLACE,([^<>/\s\w]),1 ,{NUM_TOPICS*}}</li>
                <li><span class="field_name">{!COUNT_POSTS}:</span> {$PREG_REPLACE,([^<>/\s\w]),1 ,{NUM_POSTS*}}</li>
            </ul>
        {+END}
    </td>
    {+START,IF,{$NOT,{$MOBILE}}}
        <td class="ocf_forum_num_topics ocf_column4">
            {$PREG_REPLACE,([^<>/\s\w]),1 ,{NUM_TOPICS*}}
        </td>
        <td class="ocf_forum_num_posts ocf_column5">
            {$PREG_REPLACE,([^<>/\s\w]),1 ,{NUM_POSTS*}}
        </td>
    {+END}
    <td class="ocf_forum_latest ocf_column6">
        {LATEST}
    </td>
</tr>
Back to the top
 
Posted
Rating:
#89902
Avatar

Community saint

Hmm that doesn't seem to work for me….

I am sure it is supposed to since you have tested it. Odd…

Legends of Nor'Ova: A site powered by ocPortal; home of the Legends of Nor'Ova tabletop RPG wiki and community.

Like ocPortal? Want to thank Chris and gang somehow? Then help out in the chat room! It really needs your help! Just open it in a tab everytime you open your web browser, and when you hear a "ding", check it out!

"Those who want help should first be willing to give help."
Back to the top
 
Posted
Rating:
#89907
Avatar

Community saint

I did test it (but without actually applying CSS just inspecting code output that it showed up and it worked fine.

This was just for Forum index though. I suppose another template is needed for  an index of topics with a particular forum.
Back to the top
 
Posted
Rating:
#89908
Avatar

Community saint

Right, and I was trying for forum index.

I have to wonder if column color is somehow interfering with trying to use row color. I did append !important tags to my .row_even and .row_odd in CSS, but no cigar.

It is perplexing. I feel it should be working… but yeah.

Legends of Nor'Ova: A site powered by ocPortal; home of the Legends of Nor'Ova tabletop RPG wiki and community.

Like ocPortal? Want to thank Chris and gang somehow? Then help out in the chat room! It really needs your help! Just open it in a tab everytime you open your web browser, and when you hear a "ding", check it out!

"Those who want help should first be willing to give help."
Back to the top
 
Posted
Rating:
#89909
Avatar

Community saint

For in the Topic list screen you want ocf_forum_topic_row.tpl
Back to the top
 
Posted
Rating:
#89910
Avatar

Community saint

is the html being output? if so the maybe you need to re-position the new CSS to come after the current?
Back to the top
 
Posted
Item has a rating of 5 (Liked by FletchLiked by Jean)  
Rating:
#89912
Avatar

Community saint

Note I did a quick test and I added this CSS to global and it  worked:

.row_even td{
background-color: #F00;
}

this I tested on the one in topic list not forim index
Back to the top
 
Posted
Rating:
#89914
Avatar

Community saint

Yup, that did the trick for forum index view.

I guess the issue was the resulting .row_even and .row_odd needed to be in global.css and not ocf.css.


Legends of Nor'Ova: A site powered by ocPortal; home of the Legends of Nor'Ova tabletop RPG wiki and community.

Like ocPortal? Want to thank Chris and gang somehow? Then help out in the chat room! It really needs your help! Just open it in a tab everytime you open your web browser, and when you hear a "ding", check it out!

"Those who want help should first be willing to give help."
Back to the top
 
Posted
Rating:
#89915
Avatar

Community saint

And adding that template edit to ocf_forum_topic_row.tpl makes it so that it also affects topics within a forum! Awesome *nods*!

Legends of Nor'Ova: A site powered by ocPortal; home of the Legends of Nor'Ova tabletop RPG wiki and community.

Like ocPortal? Want to thank Chris and gang somehow? Then help out in the chat room! It really needs your help! Just open it in a tab everytime you open your web browser, and when you hear a "ding", check it out!

"Those who want help should first be willing to give help."
Back to the top
 
Posted
Item has a rating of 5 (Liked by FletchLiked by JeanLiked by mythus)  
Rating:
#89917
Avatar

Community saint

Also note that the $CYCLE can take more arguments so instead of row_odd and row_even you could have row_1, row_2, row_3 in case you wanted to get even fancier.
Back to the top
 
Posted
Item has a rating of 5 (Liked by Jean)  
Rating:
#89920
Avatar

Forget zebra striping, make rainbow striping  :lol: !


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Expand