Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.
SOLVED

AEM cloud - target _blank & _self issue

Avatar

Level 4

Hi Team,

Did anyone face the below issue. If yes please help me to provide your suggestions to resolve it.

"Opens in a new tab" is getting added when I check the checkbox & it's not adding when the checkbox is unchecked.

AEM version: 2023.1.10912.20230130T173736Z-220900

 

Lakshmi9_0-1681111140690.png

Lakshmi9_1-1681111186656.png

 

Lakshmi9_3-1681111240556.png

 

Thanks!

 

1 Accepted Solution

Avatar

Correct answer by
Level 2

Seems this is added to address accessibility, Please refer the link. Adding the snippet here for easy reference,

Not hiding the accessibility text was actually intended. On a project level, there are (at least) two options:

View solution in original post

8 Replies

Avatar

Level 5

Hi Lakshmi,

The properties which you are given in the Screenshot is correct, Might be issue in your HTL code you can check it.

Try with target="${properties.target}"

Thanks

Nandheswara

Avatar

Level 5

can you provide your dialog xml and htl code then i can check the issue.

Avatar

Community Advisor

Hi @Lakshmi9 

 

   I tried this in a vanilla instance and I am not able to replicate this issue. Are you sure this is not hardcoded in your code. Could you recheck ? Else can you share the steps to replicate this issue ? Because I can see you have given only the checkbox field dialog properties , and even after doing the same with my components , I couldn't replicate this issue.

 

Thanks

Veena ✌

Avatar

Level 4

Hi @VeenaVikraman 

no extra code has been added for this except dialog n html. But observed in the elements below tag is getting added in inside a tag.

 

<span class="cmp-link__screen-reader-only">(opens in a new tab)</span>

 

Same observed for OOTB components which is having the same functionality.

 

Thank you!

Avatar

Community Advisor

Please correct me if I am wrong ,

 

So you created a new component and added the checkbox . Created a HTL file added the code to render the same ? 

Avatar

Level 2

this generate tag <span class="cmp-link__screen-reader-only">(opens in a new tab)</span> is added by the 

clientlib core.wcm.components.commons.site.link, this clientlib is part of embed properties of clientlibs-base

 

if you remove it's reference from embed properties as a test purpose, you see that will not generate the tag automatically

 

the purpose of this library is to only added this generated tag after your link,
you can check the code by accessing the crx in libs/core/wcm/components/commons/site/link

the best practice it's not edit anything in libs path but only in apps path, you can overlay this libray to change it's pattern or remove it from embed properties at clientlibs-base, however, this is just a observation not a recommendation do it at your own risk

regards,
ribeiro

Avatar

Correct answer by
Level 2

Seems this is added to address accessibility, Please refer the link. Adding the snippet here for easy reference,

Not hiding the accessibility text was actually intended. On a project level, there are (at least) two options: