Main
Index
Search
Posts
Who's
Online
Log
In

Home: Discontinued/Classic Products: Article Manager 2:
Article Lists - Rotating Row Color

 

 


LostCoder
User

Dec 1, 2006, 9:33 AM

Post #1 of 3 (637 views)
Shortcut
Article Lists - Rotating Row Color Can't Post

Hi,

I posted this in another thread a couple days ago and it may have been overlooked. Was hoping someone might be able to help me figure out how to code this up:



In my article list, I am listing each article on it's own row in 3 columns as follows:

ARTICLE TITLE | DATE | CATEGORY

What I am trying to do is rotate the background color of the row. So, the first row might be light grey, and the second row might be white, much like the Category List area in the AM 2.0 "Categories' tab.

Here is a sample of the code i am using in my ArticleList Rule:

<table width="770" border="1" cellpadding="0" cellspacing="0" bordercolor="#999999">

<!-- template insert : $articleList$ -->

<!-- templatecell : articleRow -->
<tr>
<td width="470"><div id="list_item"><a href="$published.articlePage.url$">$article.title$</a></div></td>
<td width="200"><div id="list_item">$article.date:format(MMMM d, yyyy)$</div></td>
<td width="100"><div id="list_item">$category.name$</div></td>
</tr>
<!-- /templatecell : articleRow -->
<!-- templateIf : $articleList$ eq "" -->
<tr><td>No articles available for this category</td></tr>
<!-- /templateIf -->


<!-- templateCell : pageDefault.embeddedMedia -->

<!-- templateIf : $file.caption$ ne '' -->
<!-- /templateIf -->

<!-- templateIf : $file.caption$ eq '' -->
<!-- /templateIf -->

<!-- /templateCell : pageDefault.embeddedMedia -->

</tr>
</table>


---Do you have any ideas on how to make the row color rotate ?



Thanks.



LC

Any help would be very much appreciated.

Thanks.

LC


dbramley
User

Dec 2, 2006, 6:24 AM

Post #2 of 3 (627 views)
Shortcut
Re: [LostCoder] Article Lists - Rotating Row Color [In reply to] Can't Post

Hi,
I've just had a quick play around and managed to get this working for me using a template if command set inside the table cell.

Stick the following code inside the <TD> tag of the cell you want to change the background colour of:

[templateIf : $articleList.currentResultCounter$ isMultipleOf "2"] bgcolor="#E6E6E6" [/templateIf]

Set the bgcolour to whatever colour you want.

The isMultipleOf "2" bit makes it repeat every second row.

$articleList.currentResultCounter$ is a counter generater which tells you how many articles have been listed so far.

Hope this works for you, good luck!

Dan
[hr] 
[url "http://www.thisisstockton.co.uk"]Stockton on Tees[/url] | [url "http://www.thisishartlepool.co.uk"]Hartlepool[/url] | [url "http://www.thisismiddlesbrough.com"]Middlesbrough[/url] | [url "http://www.thisissunderland.com"]Sunderland[/url] 


LostCoder
User

Dec 3, 2006, 12:28 PM

Post #3 of 3 (616 views)
Shortcut
Re: [dbramley] Article Lists - Rotating Row Color [In reply to] Can't Post

Right on!

Thanks a bunch!

LC