Jump to content

How to allow data-attribute in posts?


Go to solution Solved by Stuart Silvester,

Recommended Posts

Posted

Hello.

I need to allow to post an attribute like data-customanchor="value", what is the correct way to do that?

I've tried to play around with setting "Allowed javascript controllers" in editor's settings, but didn't figured out how to use it (also did not found any examples or docs on how to use this setting).

Thanks.

  • Solution
Posted

You would need to write a plugin to overload \IPS\Text\Parser::_htmlPurifierModifyHtmlDefinition() to whitelist your custom attribute on the chosen tag. I would recommend taking a look at that method to see how we're whitelisting certain attributes.

Allowed JavaScript controllers is purely for controllers (data-controller attributes that we use to load JS)

  • 1 year later...
Posted
On 6/10/2019 at 1:47 PM, Stuart Silvester said:

Allowed JavaScript controllers is purely for controllers (data-controller attributes that we use to load JS)

Is there a guide for available data-controller?

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...