Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Sorting links with Linklist
Having a small issue with a linklist tag. I have this code:
<txp:linklist break="li" category="mylinkcategory" sort="linksort asc" wraptag="ul" class="height200" />
All works fine, except for the fact that I have about 20 links in this link category. In the links tab, I have sorted each link like so: 1, 2, 3, 4 etc.
Theoretically, this should work, but once the links get to 10,11,12 etc., then the 11th link displays under the first link instead of after the 10th.
From 1-10 the links display correctly, its only after the 10th link I have issues. A bug maybe?
Running 4.05, because there are some plugins on this install that I am not sure are ready for 4.06.
Offline
Re: Sorting links with Linklist
not tested but what happens when you try “linksort + 0 asc”
Offline
Re: Sorting links with Linklist
And what about sorting them as: 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11… ?
Offline
#4 2008-02-21 03:34:35
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Sorting links with Linklist
Try:
<txp:linklist break="li" category="mylinkcategory" sort="cast(linksort as signed) asc" wraptag="ul" class="height200" />
Offline
Re: Sorting links with Linklist
Thanks everyone. I used Mary’s suggestion, which works fine. Is this a bug Mary?
Offline
#6 2008-02-25 01:10:42
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Sorting links with Linklist
Nope. The linksort field is a text type field, so it would sort the way text is sorted. What I’ve posted converts the field to a numeric type field, which allows you to sort the way numbers are sorted.
Offline
Re: Sorting links with Linklist
Its a nice feature to have sorting by numbers, because that’s the way most people/clients sort their links. Will this become a feature? The Textbook entry is not very specific on the sort option (how to use it).
Offline
Pages: 1