Looked in the forums but could not find an answer. I am using the cataloger and I want to display a page with items. But I want the first row to have a white background and the second row a different color. The third row has to be white again and and fourth the same color as the second and so on.
I know how to do the css styling but how can I manage this in the code? I have to define two rows in the Cataloger templates I guess but how can I tell Cataloger these are seperate items?
Hope someone has an idea.
Display two different rows of items
-
jackgittes
- Forum Members

- Posts: 23
- Joined: Mon Sep 28, 2009 9:04 pm
Re: Display two different rows of items
Depends on how you are making the rows, one way is to give them a class and use css to style the class the way you want...
-
jackgittes
- Forum Members

- Posts: 23
- Joined: Mon Sep 28, 2009 9:04 pm
Re: Display two different rows of items
I don't see how I could solve this with only css.
This is what Cataloger has to generate:
And this is what is now in my cataloger template:
This code goes wrong because it generates every group double. The idea is that it fills the first with group 1 and the second with group 2 (just like in the first code block). But now it fills both with the same group.
Any idea?
This is what Cataloger has to generate:
Code: Select all
<ul id="subgroepen">
<li class="white"><a href="#">Group 1</a></li>
<li class="blue"><a href="#">Group 2</a></li>
<li class="white"><a href="#">Group 3</a></li>
<li class="blue"><a href="#">Group 4</a>
</li>
</ul
Code: Select all
<ul id="subgroepen">
{section name=numloop loop=$items}
<li class="white"><a href="{$items[numloop].link}">{$items[numloop].title}</a></li>
<li class="white"><a href="{$items[numloop].link}">{$items[numloop].title}</a></li>
{/section}
</ul>
Any idea?
Last edited by jackgittes on Sat Jan 23, 2010 9:11 pm, edited 1 time in total.
Re: Display two different rows of items
Then you need to use some code to cycle thru them, something like this...
{capture assign="capturer"}
{cycle values="even,odd" name="capturername"}
{/capture}
Then in your for each something like this, with only one call for the li not 2 as it is now...
{capture assign="capturer"}
{cycle values="even,odd" name="capturername"}
{/capture}
Then in your for each something like this, with only one call for the li not 2 as it is now...

