Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-03-09 00:58:12

shilmy
Member
Registered: 2006-04-29
Posts: 49

Displaying random article(s) from more than one section?

My site have several sections, and I want to display random article(s) from those section. Can textpattern do it?

Thanks.
Sjarief

Offline

#2 2008-03-09 01:29:38

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Displaying random article(s) from more than one section?

<txp:article_custom section="section1,section2,section7" sort="rand()" limit="1" />. If you want articles from all sections leave out the section attribute. Change the limit attribute to how many articles you want to display.

Or did you mean one random article from each section?

Offline

#3 2008-03-09 01:53:55

shilmy
Member
Registered: 2006-04-29
Posts: 49

Re: Displaying random article(s) from more than one section?

Thanks, this is exactly what I need. I just didn’t realize that I could put more than one section in txp:article tag.

Offline

#4 2008-03-09 01:58:09

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Displaying random article(s) from more than one section?

Only since 4.0.6 :)

Offline

Board footer

Powered by FluxBB