Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#13 2011-03-04 16:49:36
- redbot
- Plugin Author
- Registered: 2006-02-14
- Posts: 1,410
Re: Can <txp:images> remain unsorted?
Bloke wrote:
… So this trick is actually pretty handy and I’d be loathe to lose it because it fills a gap in the function suite. Maybe if the article_image tag is modded one day to allow it to output its raw value then this loophole can be closed. But not before: it’s too useful!
Totally agree.
Offline
#14 2011-04-22 02:51:42
- gomedia
- Plugin Author
- Registered: 2008-06-01
- Posts: 1,373
Re: Can <txp:images> remain unsorted?
I was going to have a moan about the lack of unsorted image capability but having read this and this, I can appreciate the issues.
Just for the record – I’m not using the Article Image field so here’s an alternative & similar approach:
<txp:variable name="count" value="0" />
<txp:variable name="img_list" value="9,11,12,10,28" />
<txp:images id='<txp:variable name="img_list"/>' break="" sort='field(id,<txp:variable name="img_list"/>)'>
<txp:adi_calc name="count" add="1" />
<txp:image html_id='img<txp:variable name="count" />' width="0" height="0" />
</txp:images>
and I’m using a counter to assign a unique HTML id to each image.
Now then, let’s look at this from a different angle. With articles, it’s possible to fiddle with the posted date/time to get the sorted output into the desired order.
With images it’s not – the date/time of upload is stored but can’t changed. If the Image Edit tab allowed this to be modified then we could use sort="date asc/desc"
to achieve the required output.
Offline
#15 2011-05-08 23:58:58
- gomedia
- Plugin Author
- Registered: 2008-06-01
- Posts: 1,373
Re: Can <txp:images> remain unsorted?
gomedia wrote:
If the Image Edit tab allowed this to be modified then we could use
sort="date asc/desc"
to achieve the required output.
and as if by magic … adi_image_tab
Offline