Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2017-03-11 17:42:53

bashirnoori
Member
From: Afghanistan
Registered: 2012-10-02
Posts: 84

How to add numbering on each item of article listing ?

How to add number on each item, numbering start from 1,2,3,… <div class="number">number with each item appear here</div>

<txp:article_custom category="news">
   <li><div class="number">1</div> <txp:title /></li>
</txp:article_custom>

Offline

#2 2017-03-11 18:28:14

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,315

Re: How to add numbering on each item of article listing ?

Have a look at this post.

There’s talking of a modified plugin. Follow that link. Can’t tell you, though, how to make that plugin work with writing to the DB (which it was actually developed before) and work with variables in memory. But you’ll probably get your second issue right, very soon :)


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#3 2017-03-11 18:40:47

etc
Developer
Registered: 2010-11-11
Posts: 5,397
Website GitHub

Re: How to add numbering on each item of article listing ?

I would suggest that you try CSS counters and share once it works :-)

Offline

#4 2017-03-11 19:19:10

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,315

Re: How to add numbering on each item of article listing ?

Oleg, you’re right, I perceived it like <div class="number1"></div>.

In that case, Bashir, you could use rvm_counter as available on vanmelick.com/txp for solving your neighboured issue (which in the meantime was most likely solved by etc/Oleg, too) and CSS counters for this one here.

Last edited by uli (2017-03-11 19:33:35)


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#5 2017-03-12 05:10:51

bashirnoori
Member
From: Afghanistan
Registered: 2012-10-02
Posts: 84

Re: How to add numbering on each item of article listing ?

thanks all, i made that with CSS :-)

Offline

#6 2017-03-12 06:32:40

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,120
Website Mastodon

Re: How to add numbering on each item of article listing ?

bashirnoori wrote #304622:

thanks all, i made that with CSS :-)

share once it works :-)


…. texted postive

Offline

#7 2017-03-12 09:19:14

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Re: How to add numbering on each item of article listing ?

Why don’t you just use an <ol> list?

Offline

Board footer

Powered by FluxBB