Message Boards

How to override clay component?

Václav Suchánek, modified 3 Years ago.

How to override clay component?

Junior Member Posts: 26 Join Date: 8/15/18 Recent Posts
Hello,

When I look at Liferay front-end development I can see there is a lot of things replaced with react or clay components.
The classic liferay-ui components/taglibs is possible to override thanks to JSP overrides and it is very handy.
But these liferay-ui components are continuously replaced with clay components. And I can't see some elegant way how to customize clay components.
Every clay component offers its property, but what if I need to slightly customize HTML structure?
I can easily replace clay component with hardcoded HTML structure, but that is not what I'm looking for.

Example:
Clay component: <clay:management-toolbar> has creationMenu and this menu has some dropdown items.
I'm able to set href, label and another properties on dropdownItems.
But what if I want to add a new attribute like data-senna-off="true" to <a> link element inside of dropdown item?
Is there some elegant way how to achieve this?


Thanks in advance.

Vaclav