Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-09-13 17:48:45

draganbabic
Member
From: Novi Sad, Serbia
Registered: 2006-09-27
Posts: 118
Website

I need a foreach in an article list

Hi guys, I am again in a situation in which I find myself pretty often – I need a class attribute on an element in a list of elements (on the forth, third, doesn’t matter) and I don’t know how to do that in txp. Take a look at this image to make things clearer:

Basically my article list is output as an unordered list and list items are floated to the left and have a right margin of 10px. I need to add a class .last to every third list item so I could strip the right margin for it and make a pixel-perfect layout. Is this possible?

Thanks in advance!

Offline

#2 2007-09-13 18:49:25

iblastoff
Plugin Author
From: Toronto
Registered: 2006-06-11
Posts: 1,197
Website

Re: I need a foreach in an article list

maybe zem_nth could help you

Offline

#3 2007-09-13 20:56:01

draganbabic
Member
From: Novi Sad, Serbia
Registered: 2006-09-27
Posts: 118
Website

Re: I need a foreach in an article list

Zem nth did the trick!!! Thanks so much iblastoff!!!

Offline

#4 2007-09-13 21:35:41

iblastoff
Plugin Author
From: Toronto
Registered: 2006-06-11
Posts: 1,197
Website

Re: I need a foreach in an article list

no problem!

Offline

Board footer

Powered by FluxBB