Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#31 2017-03-25 23:10:15

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

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

#32 2017-03-26 08:32:22

phiw13
Plugin Author
From: South-Western Japan
Registered: 2004-02-27
Posts: 3,669
Website

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, labeltag and escape) 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

#33 2017-03-26 11:41:47

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,566
Website GitHub Mastodon

Re: RFC: core attributes

Also as part of this patch Oleg has allowed JSON encodings via the escape="json" attribute. Needs testing.

Offline

#34 2017-03-26 17:54:04

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

Re: RFC: core attributes

phiw13 wrote #305038:

But atts? That is new, right? Does that imply the ability to add attributes (such as aria-* or data-*)?

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

#35 2017-03-27 01:47:22

phiw13
Plugin Author
From: South-Western Japan
Registered: 2004-02-27
Posts: 3,669
Website

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, lable and escape should 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

Board footer

Powered by FluxBB