Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
article custom - title ascending with numbers
if i have a set of articles that say:
article #1
article #2…
article #10
article #11
article #12
if i set the sort value to title ascending, it will go article #1, article #10, article #11
does anyone know how to fix this?
Offline
Re: article custom - title ascending with numbers
sort="Title+0 ASC"
The +0 part forces the Title string into a number, so it sorts numerically instead of alphabetically as a string would.
Offline
Re: article custom - title ascending with numbers
awesome, thanks will try that out soon
Offline
Re: article custom - title ascending with numbers
hmm i just tried it out and it made it so that #6 was the top of the list. strange eh?
Offline
Re: article custom - title ascending with numbers
just to follow up, i still have not resolved this problem. thanks
Offline
Re: article custom - title ascending with numbers
You could rename the articles to:
article #001
article #002
article #010
article #011
article #012
to achieve the result you want.
Offline
Re: article custom - title ascending with numbers
ok in that case i should make a custom field to achieve that because adding the 0 in front will detract from the appearance. thank you
Offline
Re: article custom - title ascending with numbers
What exactly is the value of the title field you’re using… is it #1
or just 1
or something like 1 some text
?
Offline
Re: article custom - title ascending with numbers
mrtunes wrote:
adding the 0 in front will detract from the appearance.
Well, they do say beauty is in the eye of the beholder :-).
Offline
Re: article custom - title ascending with numbers
ruud wrote:
What exactly is the value of the title field you’re using… is it
#1
or just1
or something like1 some text
?
the artist didn’t name the photos so we just left them at textures #1, textures #2… and up to textures #16
Offline
Re: article custom - title ascending with numbers
Try this (not tested):
sort="SUBSTRING_INDEX(Title, CHAR(35), -1)+0 ASC"
Offline