Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: RFC: core attributes
For early adopters: I’ve made an attempt to introduce the global attributes (currently wraptag, class, html_id, atts, label, labeltag and escape) in this branch. Every tag (core or plugin) automatically accepts them now:
<txp:prev_title wraptag="h2" class="prev" html_id="prevtest" atts='rel="prev"' label="Previous" labeltag="h4" />
should work fine, even if <txp:prev_title /> still ignores all attributes. So new plugins do not need to treat these common attributes, unless they do something unusual with them. But some very old plugins could not play well.
Offline
Re: RFC: core attributes
etc wrote #305034:
For early adopters: I’ve made an attempt to introduce the global attributes (currently
wraptag,class,html_id,atts,label,labeltagandescape) in this branch.
Oh, that sounds nice! I‘ll have play with this next week.
But atts? That is new, right? Does that imply the ability to add attributes (such as aria-* or data-*)?
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg
Offline
Re: RFC: core attributes
Also as part of this patch Oleg has allowed JSON encodings via the escape="json" attribute. Needs testing.
Offline
Re: RFC: core attributes
phiw13 wrote #305038:
But
atts? That is new, right? Does that imply the ability to add attributes (such asaria-*ordata-*)?
Not quite new, though I don’t remember which tags support it. And yes, you could add any attribute with atts, but it feels a bit dirty. We’ll decide on it later, atm it’s important to test the feasibility, as Phil says. Note that the tags already supporting wraptag, lable and escape should not be concerned by this change atm.
Offline
Re: RFC: core attributes
etc wrote #305044:
Not quite new, though I don’t remember which tags support it. And yes, you could add any attribute with
atts, but it feels a bit dirty.
OK. I don’t often have a need to add attributes. Once I think I needed it, I ended up building the whole thing more manually and add the attribute with JS.
Note that the tags already supporting
wraptag,lableandescapeshould not be concerned by this change atm.
Yeah, I figured that one out :-) When I have time later this week, I‘ll take your branch for a walk in the bushes, and play with tags that currently don’t support those global attributes (me will go checking the docs to verify that). Hmm, and see if the plugins in use don’t throw any kind of protest.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg
Offline