How to set `cq:tagName` to a custom elment name? | Community
Skip to main content
January 21, 2022
Solved

How to set `cq:tagName` to a custom elment name?

  • January 21, 2022
  • 1 reply
  • 1613 views

for AEM components it is possible to set the wrapper elements markup via the `cq:htmlTag` > `cq:tagName` attribute. e.g. `cq:tagName = "ul" `.

But when i set its value to a custom element. e.g. `cq:tagName = "my-teaser" `, then the wrapper element is not rendered.

 

Is there a workaround for this issue?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by lukasz-m

Hi @mbehzad, I've checked it on AEM 6.5.11 and it looks to work fine as well. So probably issue that you can see is side effect of some customization from you code. Could you please share full stacktrace with error you have mentioned? Maybe this will allow to identify what is the root cause of the problem.

1 reply

lukasz-m
Community Advisor
Community Advisor
January 22, 2022

Hi @mbehzad, I was able to set custom decoration tag without any problem - I did it on AEM 6.5.7 and AEM 6.5.10. Please see below screens, I believe this is the result you wanted to achieve.

Do you have any customization on your AEM instance that could have impact on com.day.cq.wcm.core.impl.WCMComponentFilter - this is filter that is responsible to add decoration tag.

What version of AEM are you using?

mbehzadAuthor
January 22, 2022

Hi @lukasz-m , thank you for your response. I'm using AEM 6.5.11.0

I couldn't find any references to com.day.cq.wcm.core.impl.WCMComponentFilter in the codebase. But it occurs in a stack trace in the error log.

When i create the component in the author, then i can see the custom element in the devtools's element pannel. but after a page refresh the wrapper element isn't rendered.

lukasz-m
Community Advisor
lukasz-mCommunity AdvisorAccepted solution
Community Advisor
January 23, 2022

Hi @mbehzad, I've checked it on AEM 6.5.11 and it looks to work fine as well. So probably issue that you can see is side effect of some customization from you code. Could you please share full stacktrace with error you have mentioned? Maybe this will allow to identify what is the root cause of the problem.