Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2024-04-03 09:26:08

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

Global 'form' attribute, really?

We have briefly discussed it somewhere, and now it’s in dev, but I have some doubts. The idea is to automatically enable form attribute for (almost) every container tag used in single mode. This makes, e.g.

<txp:variable name="test" form="testform" />

roughly equivalent to

<txp:variable name="test"><txp::testform /></txp:variable>

Nice so far, but

  • this does not save so much typing
  • nor allows passing arguments to <txp::testform />
  • more importantly, if a plugin needs to use form attribute in a non-standard way (à la <txp:output_form />), it is out of luck.

Is it worth bothering?

Offline

#2 2024-04-04 06:00:05

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

Re: Global 'form' attribute, really?

If it does not pass the arguments to the <txp::testform />, I’m wondering if there is a point to it. Maybe someone here may have an idea of other cases that can make this a functioning suggestion.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#3 2024-04-04 07:25:10

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,187
Website

Re: Global 'form' attribute, really?

Can you explain a little more what you are trying to achieve here? Some kind of parity with other attributes? Some performance boost?

At first sight, I see very little benefit (e.g. the loss of arguments, in agreement with Yiannis) and more ambivalence and complexity.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#4 2024-04-04 08:14:56

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

Re: Global 'form' attribute, really?

No worries, shortcodes will not loose their arguments. The idea is just to globally enable form attribute (used in the standard way) for all tags, including these that currently do not support it. So, instead of

<txp:sometag><txp::testform /></txp:sometag>

one could use a little shorter

<txp:sometag form="testform" />

But I don’t see much benefit here, except for attributes uniformity among tags.

Here is where it all started.

Offline

#5 2024-04-04 08:34:27

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,187
Website

Re: Global 'form' attribute, really?

etc wrote #337015:

No worries, shortcodes will not loose their arguments.

That is not how I understood it. I only read as your form, used as the value for the form attribute, would not be able to have/use arguments like it can otherwise

The idea is just to globally enable form attribute (used in the standard way) for all tags, including these that currently do not support it. So, instead of

More like technical internal purity then ?

Here is where it all started.

I see. I remember reading that, but not seeing much in the discussion.

Edit: proof reading helps

Last edited by phiw13 (2024-04-04 08:35:32)


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#6 2024-04-04 09:28:28

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

Re: Global 'form' attribute, really?

phiw13 wrote #337016:

your form, used as the value for the form attribute, would not be able to have/use arguments like it can otherwise

Exactly, though this is already the case of form-aware tags. This could actually be doable, but needs some internal workflow changes. Core can be accommodated, but some plugins might break.

More like technical internal purity then ?

Ultimately, yes, but also for user commodity: you wouldn’t have to remember whether a tag supports form or not.

An amazing by-case is <txp:php form="some_php_code" />. Since the code comes from a form, even low-privs users would be able to execute php this way.

But my gut feeling is that all this is a txp5 thing, where some bwc loss is expected.

Offline

#7 2024-04-04 09:39:37

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

Re: Global 'form' attribute, really?

I concur with your gut feel. At this late stage in the 4.9 dev cycle, I’d defer this kind of change to the next release.


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

#8 2024-04-04 16:40:33

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

Re: Global 'form' attribute, really?

Gone.

Offline

Board footer

Powered by FluxBB