Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Unlimited lists
Although not specifically related to them, with the advent of pageless sections and calling content in from other (hidden) sections to a single page potentially being more commonplace, we’ll often use:
<txp:article_custom section="pageless-content" form="some-form" limit="999" />
(among many other traditional uses for article_custom, such as counting total articles, setting variables, filtering articles, and so forth).
Dunno about anyone else but, it’s always seemed a bit of a hack to have to include a limit there to get “everything”. Is there any syntax we could offer that would mean ‘all’ without breaking backwards compatibility?
I wondered if perhaps just valueless limit
might work, but that currently returns the same as limit="1"
.
Any thoughts on this?
Last edited by Bloke (2020-05-28 16:11:05)
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
Online
Re: Unlimited lists
Maybe all="1"
which can be shorthanded to all
? That would need to override the limit
field if both were present.
Or limit="all"
. Or limit="none"
at a push. Both of those could be misinterpreted though, I feel.
Offline
Re: Unlimited lists
Yeah, thanks. I was thinking of some magic non-numeric value for limit
too. But, as you say, it’s not so obvious what they mean:
limit="none"
could mean unlimited, or that limit should have no effect, or that there should be no articles returned.limit="all"
could mean unlimited, or that all limits apply (whatever that may imply).limit="0"
is unintuitive and could mean unlimited or return no content (which is what it currently does).- a new attribute like
all
is cleanest, but those three letters in a complicated article tag with a tonne of other attributes could be easy to miss/debug.
I dunno. Maybe it’s something we have to live with. Be interesting if anyone has any ideas that might lead us to a solution that’s unambiguous.
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
Online
Re: Unlimited lists
limit="no"
? limit="null"
? limit="ignore"
? limit="ignored"
?
Offline
Re: Unlimited lists
Just keep in mind that it is impossible to do globally and hence must be done tag by tag, for consistency.
Offline
Re: Unlimited lists
etc wrote #323369:
Just keep in mind that it is impossible to do globally and hence must be done tag by tag, for consistency.
That’s a good point. Hmmm. Maybe I should just shut up and save us work :)
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
Online
Re: Unlimited lists
I would think that people who will be using pageless-content sections will be thinking about them in different ways to how we are currently using sections.
A way would be limitless as Stef suggested, and demoncleaner has demonstrated with his ‘teams’ pages, another would be to create a front page of an existing section, similarly to how many use sticky articles. As such, I think that the id or status of the articles would be much more important. Limit would indeed be handy as well, but I think that we are all thinking from within the txp box for now.
As such I agree with Oleg, that pageless sections should have the same attributes as the rest of the sections, until we experiment enough and find the limits of this feature.
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: Unlimited lists
colak wrote #323371:
pageless sections should have the same attributes as the rest of the sections, until we experiment enough and find the limits of this feature.
Sorry, to be clear I wasn’t specifically talking about pageless content here (I’ve edited the OP to clarify). It just cropped up because I was thinking about it. I’m referring to our use of limit
everywhere, in all tags.
People often use <txp:article_custom section="blah" limit="9999">... some conditional content ...</txp:article_custom>
to extract some or all posts, or count stuff, or set variables, and the 9999 thing always seems hackish to me.
Last edited by Bloke (2020-05-28 16:10:23)
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
Online
Re: Unlimited lists
Bloke wrote #323372:
Sorry, to be clear I wasn’t specifically talking about pageless content here (I’ve edited the OP to clarify). It just cropped up because I was thinking about it. I’m referring to our use of
limit
everywhere, in all tags.People often use
<txp:article_custom section="blah" limit="9999">... some conditional content ...</txp:article_custom>
to extract some or all posts, or count stuff, or set variables, and the 9999 thing always seems hackish to me.
Whoops, as usual I misunderstood. I’m easy either way but I know what you mean. I know it is counter-intuitive but I agree with limit="0"
as an option when thinking in binary.
>Edited to add. I also agree that as this is mostly an aesthetic change, which requires more work than just changing a global variable, I would spend my time in something more functional.
Last edited by colak (2020-05-28 17:26:53)
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: Unlimited lists
For the youth: limit="♾️"
, and for the greybeards limit="∞"
(I’m posting this in jest, for clarity, but I would be overjoyed if some sparkly etcMagick© happened and this became an Easter egg.)
Offline
Re: Unlimited lists
I suppose limit="unlimited"
is a bit much to type? How about limit="unset"
, or even limit="..."
?
TXP Builders – finely-crafted code, design and txp
Offline
Re: Unlimited lists
Bloke wrote #323367:
Yeah, thanks. I was thinking of some magic non-numeric value for
limit
too. But, as you say, it’s not so obvious what they mean:
limit="none"
could mean unlimited, or that limit should have no effect, or that there should be no articles returned.limit="all"
could mean unlimited, or that all limits apply (whatever that may imply).limit="0"
is unintuitive and could mean unlimited or return no content (which is what it currently does).- a new attribute like
all
is cleanest, but those three letters in a complicated article tag with a tonne of other attributes could be easy to miss/debug.
From looking through the discussion:
<txp:article_custom section="pageless-content" form="some-form" limit="unlimited" />
<txp:article_custom section="pageless-content" form="some-form" unlimited />
<txp:article_custom section="pageless-content" form="some-form" limitlesss />
Offline