Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-05-28 02:17:19

cpk
Member
Registered: 2005-08-07
Posts: 62

How can I create an incremental CSS ID on article listings

Is there a simple way to create a unique, auto incrementing CSS ID number on a form generated DIV on an article list using the wraptag? Is this something that I need to create using conditionals and variables or is there something that already exists using wraptag? I am looking to do something like the following:

<div id="ex-1">...article listing 1...</div>
<div id="ex-2">...article listing 2...</div>

Only the number needs to increase by 1 (sequential-starting with 1) for each article in the list. I need to append this number to my CSS ID.

I need something to operate similar to the old javascript for loop e.g., for (i=0;i<=1;i++)

Thanks,

cpk

Offline

#2 2010-05-28 02:19:28

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: How can I create an incremental CSS ID on article listings

Look for adi_calc plugin, that’s all you will need.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#3 2010-05-28 02:29:55

cpk
Member
Registered: 2005-08-07
Posts: 62

Re: How can I create an incremental CSS ID on article listings

Thanks for the quick response maniqui. I will check it out. Is this only possible using a plug-in? I was hoping to avoid installing a plug-in just for this one thing.

Offline

#4 2010-05-28 03:06:08

cpk
Member
Registered: 2005-08-07
Posts: 62

Re: How can I create an incremental CSS ID on article listings

I installed adi_calc and it’s working beautifully! Thanks Maniqui for a quick and easy solution. I am sure that I can find some other uses for this plug-in.

cpk

Offline

Board footer

Powered by FluxBB