Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2020-05-28 20:09:55

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

Re: Unlimited lists

Ooh, limit="..." has merit. Though I do like the Easter egg too!

I’ve just looked through our code. Oleg’s right, this is a non-trivial change. Each tag handles it differently and, somewhat annoyingly, there’s not much consistency either. The purist in me says this is an opportunity to make it more consistent and therefore predictable. There’s quite a bit of redundancy in thispage pagination code, for example.

As far as I can tell, <txp:category_list> is the only tag that does it “right” insofar as:

  • limit="{integer}" (with or without offset) will use the given value.
  • limit="" or just valueless limit will use PHP_INT_MAX, which is some huge value. So, effectively unlimited.

But it does all other kinds of stuff like using the limit in exclude and to perform cacheing, which other tags don’t have.

Realistically I don’t see many people using limit without any value at the moment, so that seems like a reasonably logical way to handle it. “I’m not giving you a value, so use whatever there is”. We just have to be careful with how we handle defaults, like 10 for contenty stuff, 5 for search_results, everything for <txp:images>, and so forth.

So if we’re going to do this, it’ll need some internal refactorisation and some heavy testing to ensure we don’t make any backwards compatibility blunders. By all means continue to throw ideas here, especially if you have any insight into how we’re handling limit in each tag now, as it might spark some revolutionary idea on how we can standardise it or at least make it more sane in code. But in terms of features, this might go on the back burner.


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

#14 2020-06-07 18:47:07

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 687
Website Mastodon

Re: Unlimited lists

nolimit="1", or in fact just nolimit, if present, then overriding the setting in limit, or just secretly setting limit="1000000001".

Might be foolish, as i have no understanding of the core. If so, please ignore.

Last edited by jayrope (2020-06-07 18:50:57)


A hole turned upside down is a dome, when there’s also gravity.

Offline

#15 2020-06-07 19:07:22

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

Re: Unlimited lists

jayrope wrote #323596:

nolimit="1", or in fact just nolimit

*starts humming* No no… no no, no no… no no, no no… no no there’s no limit


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

#16 2020-06-26 17:23:13

maverick
Member
From: Southeastern Michigan, USA
Registered: 2005-01-14
Posts: 976
Website

Re: Unlimited lists

Not sure how helpful this is – it is just my take.

I realize that the use of the word limit can be a question (eg – is there a limit) to which we are then provide a precise answer in some way of yes or no (and the subsequent question of what is the limit?).

I think there is an argument to be made, however, that omission of limit equals unlimited and the usage of limit invokes a limit of some sort.

Therefore, to me, the intuitive solution would be it is unlimited by default (omission of limit) and a limit is only imposed when the attribute is employed. The very use of the attribute is the “yes” if you will.

Thus I can save time and coding *(be lazy :-D ) by never needing to add the attribute “limit” when unlimited is desired.

All that said, if we do need to have limited have an unlimited option, I find yes/no to be straight forward. Perhaps something like limit=“y, 100”, or limit=“n”

I freely confess though I’ve no idea how easy or hard this would be to implement, and am naive to all the various use cases.

Last edited by maverick (2020-06-26 17:24:01)

Offline

Board footer

Powered by FluxBB