Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2019-02-07 12:49:09

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

etc_attribute: enable HTML attributes in txp tags

This plugin will (try to) append registered HTML attributes to the output of <txp:tags />. For example, <txp:link /> does not accept style attribute, so passing it, say, style="color:green" would issue a warning. With etc_attribute enabled, style is registered for all tags, so

<txp:link id="1" style="color:green" />

appends style="color:green" attribute to <a /> tag generated by <txp:link />, and we get

<a href=“http://textpattern.com/” style=“color:green”>Textpattern</a>

You can register additional attributes via plugins preferences. Enjoy!

Offline

#2 2019-02-07 14:37:24

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

Re: etc_attribute: enable HTML attributes in txp tags

This looks wonderfully useful for a couple of cases I can think of!


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 2019-02-08 09:25:21

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

Re: etc_attribute: enable HTML attributes in txp tags

Nice! This has been a bugbear of mine for years, having to add additional superfluous HTML tags just so I can get a desired attribute onto some HTML (such as ARIA and data-x attributes).

Offline

#4 2019-02-08 14:11:12

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

Re: etc_attribute: enable HTML attributes in txp tags

This simplicity is 4.7 global attributes in action, it was not possible before.

Offline

Board footer

Powered by FluxBB