Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Alternate 2 colours in a discussion
Hi all, firstly it's my first post so hi everyone :)
I have begun integrating vanilla onto my website but there was one small aesthetic problem i was wondering if any of you could help me with.
I saw on a vanilla forum somewhere that in each discussion, each post alternated between 2 colours, i.e.
yellow
white
yellow
white etc.
How would i go about implementing this?
Many thanks for your time,
Cheers.
0
This discussion has been closed.
Comments
Anyway, you could achieve it by modifying that part of the theme that outputs the discussion list (make a copy of that file and put it in a new folder of your own in /themes), or you could use javascript to loop through the discussions in the list once it has been output and style them alternately, for instance using the splintered striper script.
I'm no expert at this, but I think the equivalent while loop begins around line 43 and looking a little further down you can see where $CommentClass is being defined for whispered or hidden comments. I guess that is where you'd enter shaun inman's last bit and adjust it to set (append) $CommentClass to "alt" for example.
Then you should be able to style the comments with a class="alt" (or whatever you choose there).
As I said, work on a copy of comments.php in your own folder e.g./themes/yourfolder/. Likewise, copy vanilla.css to themes/yourfolder/styles/default/vanilla.css and add the styles you've declared for the alternate background. Then select your new theme from the settings page.