Expand my Community achievements bar.

SOLVED

Can I move anchors generated by the parsys to the included component's ID attribute?

Avatar

Level 2

AEM 5.6.1 - I've long wondered whether I can remove the anchors which are generated by the parsys component (for enabling linking down the page) and redefine them as ID attributes on the included resource. The anchors are an unfortunate nuisance when trying to code CSS to handle contextual styling of adjacent components.

I see that I can affect the attributes of a component by modifying the cq:htmlTag property, but that doesn't appear to be modifiable during runtime (unlike the option to get/set additional CSS classes on the component via IncludeOptions.getCssClassNames()).

Do I have any options which I've overlooked?

Thanks!

Garth

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi Garth,

Thanks for reaching out to Adobe Community!

There is nothing Out of the Box(OOTB) with AEM that will let you move anchors, but you can use Javascript to modify them.

Refer this link: http://www.the-art-of-web.com/javascript/remove-anchor-links/

Thanks,
Ratna Kumar.

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

Hi Garth,

Thanks for reaching out to Adobe Community!

There is nothing Out of the Box(OOTB) with AEM that will let you move anchors, but you can use Javascript to modify them.

Refer this link: http://www.the-art-of-web.com/javascript/remove-anchor-links/

Thanks,
Ratna Kumar.

Avatar

Level 2

Ratna Kumar wrote...

Hi Garth,

Thanks for reaching out to Adobe Community!

There is nothing Out of the Box(OOTB) with AEM that will let you move anchors, but you can use Javascript to modify them.

Refer this link: http://www.the-art-of-web.com/javascript/remove-anchor-links/

Thanks,
Ratna Kumar.

 

Thanks Ratna! That's not what I wanted to hear, but what I expected to hear. Oh well. Thank you for the response!