Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#16 2022-06-09 11:31:00

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,519
Website GitHub

Re: [attribute] breakby

Hehe. Yeah, we could do with demystifying some of the terminology. ‘string’ – while technically accurate – doesn’t really cover what you can do with it. Although a form name is a string, it triggers different behaviour because it goes and fetches a form and uses its contents rather than just using the (string) contents of the attribute verbatim.

Now that the docs repo is self-hosted (yay, Pete) we have more scope to run Jekyll and other shell scripts which weren’t available to us when hosted on GitHub. That might be helpful for us to think about this in a more program-oriented way, e.g. define tags and their attributes in some terse markup language such as YAML and run a script to generate the tags doc pages and attribute cross ref pages. Then we only ever update in one place and rerun the script to spit out the docs.

Food for thought. It’s just code. And code is pottery.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#17 2022-06-09 11:46:52

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,912
Website

Re: [attribute] breakby

phiw13 wrote #333560:

your form name is actually a “string“

Good point.

cognitively the jump to “use a form” is a little difficult for me.

Me too. But apparently it is needed for what I am trying to do.

But, again, good point on the string thing, that brought that use context out a bit for me there.

my humble understanding, “string” = “a series of alphanumerical characters”.

Yes, I think that’s correct. I just saw that explained somewhere in context of using <txp:title breakby="" yield="1" /> to give the first letter of a title, for example.

Last edited by Destry (2022-06-09 12:29:34)

Offline

#18 2022-06-09 12:12:47

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,912
Website

Re: [attribute] breakby

breakform is not in the tags attributes cross-reference, btw.

Offline

#19 2022-06-09 12:38:32

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

Re: [attribute] breakby

Well, we’ve got (currently) 3 contexts for breakby.

  1. Breaking by txp tags (inline or in a form) as described here concerns only content listing tags: <txp:article /> and its derivatives, <txp:images />, <txp:linklist /> and <txp:file_download_list />. This could change, but is technically not trivial.
  2. Breaking by numbers works for all tags (4.8.9)
  3. Breaking by character(s) works for ‘atomic’ tags, i.e. those that can not loop over a collection of items (articles, categories, etc) and thus previously had no break, limit and other ‘list’ attributes.

It’s probably too early for a definitive guide to these freshly modified attributes.

Offline

Board footer

Powered by FluxBB