Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#16 2019-11-21 11:59:55

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

Re: Ranges

gaekwad wrote #320169:

Out of curiosity: what’s a real-world example of a negative range in Textpattern terms? Bullet point is fine, I’m clearly missing something obvious.

Negative values are rare animals in txp word, but do exist. For example, shift attribute of <txp:older /> can be a range of negative values:

<txp:older link shift="-3,-2,-1">
    Page <txp:yield item="page" />
</txp:older>

will output three oldest pages (4.8 only). But I agree, that’s an exotic usage and large negative ranges are unlikely to be ever needed. So we could stay with the standard 1-9 notation and add -9- -1-ish patterns parsing as Stef suggests just in case.

Offline

Board footer

Powered by FluxBB