Asset listing Page - Different attribute to the first occurrence

Hi,


Consider the following output:

<ul>

<li class="show"><img src="1.jpg" alt="pic1" /></li>

<li><img src="2.jpg" alt="pic2" /></li>

<li><img src="3.jpg" alt="pic3" /></li>

<li><img src="4.jpg" alt="pic4" /></li>

</ul>



By using an asset listing page, how can I assign class="show" only to the first li tag?



This is going to be used as a website banner. The images will rotate using jquery by changing the class attribute every n seconds.



thank you in advanced :slight_smile:

Dorian



using matrix 3.26.3

Yes, creating a new Position Format for position 1 and you can add your format for the first asset in your list.

[quote]
Yes, creating a new Position Format for position 1 and you can add your format for the first asset in your list.

[/quote]



Hi Nic,



Many thanks, managed! I just had to assigned the class 'show' to the div instead of the li from the div properties. I then changed the jquery selector so that the div becomes hidden and not the li, since each li becomes encapsulated within a div …



Many thanks



Dorian

[quote]
Many thanks, managed! I just had to assigned the class 'show' to the div instead of the li from the div properties. I then changed the jquery selector so that the div becomes hidden and not the li, since each li becomes encapsulated within a div …

[/quote]



You don't have to have it automatically print divs. Personally I hate it doing this. Change the presentation type to RAW HTML and you won't have this problem. There is also a global preference for this so you never have to set it again.