Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2012-06-25 22:52:52

THE BLUE DRAGON
Member
From: Israel
Registered: 2007-11-16
Posts: 619
Website

Article_custom sort by variable

Hi,
I’m trying to sort article_custom in the same order as I entered the articles id’s to it,

<txp:variable name="the_articles" value="1,4,2,5,3" />

<txp:article_custom id='<txp:variable name="the_articles" />' time="any" sort='<txp:variable name="the_articles" />'>
	<txp:article_id /><br/>
</txp:article_custom>

this isn’t working,
so I will love to know how to get this to work to keep the same order as in the variable please.

Offline

#2 2012-06-25 22:59:56

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

Re: Article_custom sort by variable

Hi Gil,

try sort='FIELD(ID,<txp:variable name="the_articles" />)'


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#3 2012-06-26 08:00:21

THE BLUE DRAGON
Member
From: Israel
Registered: 2007-11-16
Posts: 619
Website

Re: Article_custom sort by variable

Thanks works great :)
Is there a documentation page that I can explore and learn all these magic tricks please?

Offline

#4 2012-06-26 13:32:30

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

Re: Article_custom sort by variable

This particular, obscure trick was taught to us by ruud, developer emeritus.

You could browse the user documentation or TXPTips to see if you find more magic tricks. Then, share them!


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB