Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
How to override clay component?
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
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
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™