Adding target = "_blank" to CQ5 Image Anchor | Community
Skip to main content
Level 4
October 16, 2015
Solved

Adding target = "_blank" to CQ5 Image Anchor

  • October 16, 2015
  • 1 reply
  • 1466 views

Hi ,

   I have a requirement in the image component where a user is given preference to choose to open  links in new window (similar to text component) . So all i need is to add   target = "_blank" to CQ5 image anchor tag on user opts for new window . The OOTB image component uses Image class which actually outputs markup using  'image.draw ' .

From adobe documentation for Image class i was not able to see any helper methods to add extra tag attributes to added to the hyperlink around the image.

Any pointers on how i can achieve it ? Once way may be to update markup using jquery but I'm sure there will be much better way to do it

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 smacdonald2008

If an AEM out of the box component does not meet your requirements, using JQuery API is a valid solution. We have many community articles that show how to use JQuery within AEM:

http://helpx.adobe.com/experience-manager/using/integrating-jquery-framework-cq.html

Here is an AEM community article that uses a JQuery API to build a custom carousel:

 http://helpx.adobe.com/experience-manager/using/custom-carousel-components.html

This article then talks about how to hook that component into a AEM dialog and add the component to the CQ sidekick:

 http://helpx.adobe.com/experience-manager/using/integrating-custom-carousel-component-cq.html

Hope this helps

1 reply

smacdonald2008
smacdonald2008Accepted solution
Level 10
October 16, 2015

If an AEM out of the box component does not meet your requirements, using JQuery API is a valid solution. We have many community articles that show how to use JQuery within AEM:

http://helpx.adobe.com/experience-manager/using/integrating-jquery-framework-cq.html

Here is an AEM community article that uses a JQuery API to build a custom carousel:

 http://helpx.adobe.com/experience-manager/using/custom-carousel-components.html

This article then talks about how to hook that component into a AEM dialog and add the component to the CQ sidekick:

 http://helpx.adobe.com/experience-manager/using/integrating-custom-carousel-component-cq.html

Hope this helps