Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2015-05-21 09:50:32

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

Internal txp tag attributes

The new parser introduced in this thread separates analyzing txp code from processing. That makes it possible to process tags in an order different from the “chronological” one. For example, currently this does not work:

<txp:older />
<txp:article />

because <txp:older /> needs <txp:article /> to be processed first.

What if we introduce some kind of “processing” txp @order attribute:

<txp:older @order="7" />
<txp:article @order="5" />

telling the parser that it should process article before older? We can assign this attribute some natural values for all txp tags, and leave users the possibility to modify them. Other “internal” attributes could be useful too, though I can not think of an example right now ( @cache?).

Offline

#2 2015-05-21 11:35:59

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,323
Website Mastodon

Re: Internal txp tag attributes

For txp:article we already have pgonly which serves a similar purpose. Are there any other tags you have in mind which have a dependency on the parsing sequence?

Offline

#3 2015-05-21 15:44:54

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

Re: Internal txp tag attributes

wet wrote #290967:

For txp:article we already have pgonly which serves a similar purpose.

Yes, but wouldn’t it be better to get rid of it? You have to remember to include it, with the same attributes that the “main” <txp:article />… I don’t like it. New users are sometimes lost.

Are there any other tags you have in mind which have a dependency on the parsing sequence?

Yes, mainly plugins. For example, <txp:etc_search /> sets pagination-related stuff too, so the same problem arises. Another example is adi_if_mobile: you have to include <txp:adi_mobile /> before using other tags. I’m sure there are other plugins that exhibit this behavior, their authors could set some default processing order with internal attributes instead.

This would require some further modifications in the parser, atm I’m just trying to see whether this feature could be useful.

Offline

Board footer

Powered by FluxBB