Rewriting jcr:content to _jcr_content | Community
Skip to main content
viren_pushpanay
Level 2
Oct 16, 2015 2:27 AM UTC

Rewriting jcr:content to _jcr_content

I have an attribute within a DIV tag thats needs to be rewritten (<div data-background="/content/abc/en/jcr:content/mainparsys/generic_banner/image.adapt.1663.high.jpg"  />). I tried all steps in the below articles but no success.

  1. http://stackoverflow.com/questions/23673616/how-to-add-additional-element-to-htmlparser-generator
  2. http://stackoverflow.com/questions/26220078/sling-mapping-rewrite-rules-do-not-rewrite-jcrcontent-paths
  3. http://helpx.adobe.com/experience-manager/using/creating-link-rewrite.html

Please let me know if there is a way that I can do it. I know that for standard html tags it's done OOTB.

Thank you.

Cheers,

Viren.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

WhoaShekhar
Level 10
Oct 16, 2015 2:27 AM UTC

Hi there,

Thanks for reaching out to Adobe Community.

Please go through the below community article and see if this helps:

http://helpx.adobe.com/experience-manager/using/programmatically-accessing-cq-content-using.html

Thanks!

Translate
smacdonald2008
Level 10
Oct 16, 2015 2:27 AM UTC

This use case is more of a general JavaScript task. There are quite a few online resources that talk about how to use JavaScript to dynamically modify DIV tags. For example:

http://stackoverflow.com/questions/2098403/rewriting-html-code-using-javascript

http://www.pixel2life.com/forums/index.php?/topic/40498-rewriting-the-contents-of-a-div-tag/

http://stackoverflow.com/questions/918792/use-jquery-to-change-an-html-tag

http://stackoverflow.com/questions/1570905/use-jquery-to-set-value-of-div-tag

The other links you referenced are about changing links within AEM. The one that Shekhar referenced talks about how to use the JCR API to get JCR content and modify nodes/props. But you need to simply modify DIV tags in content located in AEM. 

Translate