Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2019-09-09 13:05:13

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,007
Website GitHub Mastodon Twitter

Re: How to display images of range ids

etc wrote #319251:

That’s fine, 38-40 means 38,39,40. But 40, 38-40 means 40,38,39 because the last 40 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

#14 2019-09-09 13:05:27

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,250
Website GitHub

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

#15 2019-09-10 09:13:13

etc
Developer
Registered: 2010-11-11
Posts: 5,028
Website GitHub

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 the range 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

#17 2020-02-04 22:40:42

etc
Developer
Registered: 2010-11-11
Posts: 5,028
Website GitHub

Re: How to display images of range ids

Silly typo, sorry.

Offline

Board footer

Powered by FluxBB