Inserting a class name dynamically on a component&

2019-07-25 12:12发布

问题:

I am using a cq:htmlTag to generate a custom tag for one of the components.

For the "class" property, I know that I could provide a static class name that is part of a CSS file, but my requirement is to have the 'template name' as the class property value.

Does CQ provide a way to use dynamic values?

回答1:

Out of the box I think not. There are a few workarounds that I could think of:

  • Add another tag as a child where you set that class (probably not what you want)
  • Use javascript to add it on load (if it is not to late)
  • Overlay the parsys and implement your logic there


标签: css adobe aem