Textpattern CMS support forum

You are not logged in. Register | Login | Help

#11 2019-09-09 12:50:34

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 7,334
Website

Re: How to display images of range ids

Would it not be more logical if we just had what etc mentioned? ie <txp:images id="40, 38-40" />. My only problem is that when I see 38-40, I would expect the range to be inclusive. That is ids 38,39,40. When kids are asked to count from 1-10 for example, they are expected to include 10.


Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | Respbublika! | NeMe @ github

Offline

#12 2019-09-09 12:59:05

etc
Developer
Registered: 2010-11-11
Posts: 3,341
Website

Re: How to display images of range ids

colak wrote #319250:

My only problem is that when I see 38-40, I would expect the range to be inclusive. That is ids 38,39,40.

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.

Offline

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

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 7,334
Website

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.org | hblack.net | LABS | State Machines | Respbublika! | NeMe @ github

Offline

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

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,775
Website

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: 3,341
Website

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

Board footer

Powered by FluxBB