Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Custom Order of Category Links
Hi,
A linked category list is sorted alphabetically, is it possible to sort them manually, similar to how the esq_sectionsort plugin does?
Cheers,
Husain
Offline
Re: Custom Order of Category Links
To some extent, yes, if you manually order the names.
<txp:etc_query data='["cat1","cat4","cat3"]' markup="json">
<txp:category name="{?}" link="1" />
</txp:etc_query>
Edit: silly me, <txp:category_list categories="cat1,cat4,cat3" />
does the same.
Last edited by etc (2012-09-04 06:57:34)
Offline
Re: Custom Order of Category Links
Thanks Oleg! I guess this would be good if the number categories are fixed on the site. Any ideas on what if the categories are dynamic, added/modified/deleted by the admin?
Offline
Re: Custom Order of Category Links
Then what do you mean by “sort them manually”? Sorting them by id?
Offline
Re: Custom Order of Category Links
I do not know if a plugin similar to esq_sectionsort
exists for categories, sorry. If you need a central place to define the sort order, you could use adi_variables, define a variable custom_sort
, with a value like cat1,cat4,cat3
, then use
<txp:category_list categories='<txp:variable name="custom_sort" />' />
Offline
Offline
Pages: 1