Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
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
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
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
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
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
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
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
Online
Offline