Expand my Community achievements bar.

SOLVED

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

Avatar

Level 1

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?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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.

View solution in original post

4 Replies

Avatar

Community Advisor

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.

custom-decoration-crx.png

custom-decoration-markup.png

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?

Avatar

Level 1

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.

Avatar

Correct answer by
Community Advisor

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.

Avatar

Level 1

Hi, the error in the error log was in the end from some other older and unrelated issue. When the wrapper isn't rendered, there isn't any errors (any level).

I'll update this post once i find out where the customization / root of error is.