Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: How to display images of range ids
etc wrote #319251:
That’s fine,
38-40
means38,39,40
. But40, 38-40
means40,38,39
because the last40
is removed as duplicate of the first one.
👍
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: How to display images of range ids
etc wrote #319249:
I thought that could be a general-purpose tag, letting you (jointly with some
<txp:item />
tag) split plain strings
Yeah, yeah! Me likee a lot. That allows us to split custom fields via a separator by supplying them as a tag in the items
attribute. Incredibly handy, and currently only serviceable by <txp:if_custom_field>
which isn’t always applicable. Sometimes you just want the field split up without testing it, which this new tag permits.
And your ‘laborious’ hack isn’t onerous at all. I like that. What does the range
attribute do in your example, btw? Does that just denote the separator to be used for ranges? If so, what would this yield, assuming the range
attribute defaults to hyphen:
<txp:list items="I-like-dogs. I-hate-cats." separator="." break="br" wraptag="p">
<txp:item />!
</txp:list>
If it defaults to null
or its use is intended differently, no problem.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: How to display images of range ids
Bloke wrote #319253:
What does the
range
attribute do in your example, btw? Does that just denote the separator to be used for ranges? If so, what would this yield, assuming therange
attribute defaults to hyphen:
<txp:list items="I-like-dogs. I-hate-cats." separator="." break="br" wraptag="p">...
If it defaults to
null
or its use is intended differently, no problem.
Yes, range
is just the range separator (a better name is welcome). It would be unset by default, to avoid surprises, and separator=","
as usual.
But since the main concern seems to be cf, we should probably wait until our cf branch becomes dev.
Offline
#16 2020-02-04 22:17:13
- mikulas
- Member
- From: Czech republic
- Registered: 2012-03-15
- Posts: 38
Re: How to display images of range ids
Textpattern version 4.8.0 beta has support for id ranges in some tags and admin fields. So I try to display range of images using tag <txp:images />
and with ids defined in custom filed.
If both id are numbers from 1 to 9 (with separator -
), all pictures in this range are displayed. However, if any digit is greater than 9, only one image is displayed.
Did I miss anything?
Offline
Offline