NJC Posted May 20, 2006 Share Posted May 20, 2006 I would like to change the background color of alternate comments to a post. This way I can differentiate each comment, making it easier for the reader.Cheers Link to comment Share on other sites More sharing options...
snowboard01 Posted May 20, 2006 Share Posted May 20, 2006 You want the forum to have alternate colours for each post? Link to comment Share on other sites More sharing options...
NJC Posted May 20, 2006 Author Share Posted May 20, 2006 Once I create a post in my blog. People leave comments.It is these comments that I would like to differentiate. Like shade each alternate comment, Thus eg: 1st comment is shaded, the next unshaded, the following shaded and so on.Something like this: TechCrunch Link to comment Share on other sites More sharing options...
justsomeguy Posted May 20, 2006 Share Posted May 20, 2006 Someone else may be able to give you an example on how to do that with CSS, but every time I've done that myself I've just done it in the scripting code. That is, when I am writing out the comments, I have a variable to say whether or not to color the current comment, and I reverse that variable every time. So something like this (in PHP): $result = db_query("SELECT * FROM comments");$highlight = false;while ($row = db_fetch_assoc($result)){ if ($highlight) echo "<tr class=\"color2\">"; else echo "<tr class=\"color1\">"; ... display post ... $highlight = !$highlight;} Link to comment Share on other sites More sharing options...
NJC Posted May 20, 2006 Author Share Posted May 20, 2006 thanks justsomeguy.i am just about getting the hang of CSS. Forgive the ignorance, but I would not have a clue where to start with the scripting code. Appreciate your helping nontheless! Link to comment Share on other sites More sharing options...
justsomeguy Posted May 20, 2006 Share Posted May 20, 2006 It shouldn't be all that hard. The first step is to browse to the comments page, and take a look at the URL. It probably points to either an ASP or a PHP page. Figure out which page it is, and we can edit that page to do this. I don't think CSS can do this, but I may be wrong. Link to comment Share on other sites More sharing options...
reportingsjr Posted May 21, 2006 Share Posted May 21, 2006 Well, you cant post comments without SQL/php, or some other server language.. lol. Do what someguy said.. Link to comment Share on other sites More sharing options...
NJC Posted May 21, 2006 Author Share Posted May 21, 2006 Thank you for your response sjr.Maybe I am not making myself clear in what my query is.I run a blog (a community blog) @ Musoma. This is a community blog.An entry has been created @ Sunday May 14, 2006You will see that there are about 15 comments to that particular entry.What I would like to 'try' and do is to somehow separate each comment, so that the comments do not look all jumbled up. Now, for some reason that appears to be humorous, so be it. Link to comment Share on other sites More sharing options...
snowboard01 Posted May 21, 2006 Share Posted May 21, 2006 did you code this blog manualy or download it. You see to leave a comment on the site it would require either asp php or sql or a combination. So what they are trying to say isYou will probably have to edit the code Link to comment Share on other sites More sharing options...
mpoer Posted May 21, 2006 Share Posted May 21, 2006 What needs to happen is that the application - Movable Type 3.2 according to your meta data - has to alternate the CSS class of each comment. "Alternating Commments"This is done with the server-side codeing, not in CSS. However, the styles are defined in the CSS file.Looking around the Movable Type Templates, particularly the comment listing template, it looks like Movable Type does not alternate its comments.So now I must recommend WordPress for your weblog. Not only does WordPress already alternate comments and has themes to utilize the feature, but WordPress is Open Source. That means that if there is a feature you find WP to lack, you can add it in with either the program itself or as a plug-in.Transitions like this are risky and sometimes intimidating, but others have done it, so why not give it some thought? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now