Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2020-05-28 12:23:30

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

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

Offline

#2 2020-05-28 13:56:01

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

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

#3 2020-05-28 14:09:41

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

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

Offline

#4 2020-05-28 14:25:34

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Re: Unlimited lists

limit="no"? limit="null"? limit="ignore"? limit="ignored"?

Offline

#5 2020-05-28 14:28:52

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

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

#6 2020-05-28 14:31:25

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

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

Offline

#7 2020-05-28 15:52:07

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

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

#8 2020-05-28 16:06:01

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

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

Offline

#9 2020-05-28 17:21:17

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

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

#10 2020-05-28 18:17:30

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,277
GitHub

Re: Unlimited lists

For the youth: limit="♾️", and for the greybeards limit="&infin;"

(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

#11 2020-05-28 19:22:00

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,742
Website

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

#12 2020-05-28 19:28:56

michaelkpate
Moderator
From: Avon Park, FL
Registered: 2004-02-24
Posts: 1,379
Website GitHub Mastodon

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

Board footer

Powered by FluxBB