Content Transformer | Community
Skip to main content
Level 3
March 1, 2016
Solved

Content Transformer

  • March 1, 2016
  • 5 replies
  • 2262 views

Is there a way to transform content authors have entered in a component?  The ask is that we allow the authors to enter a formatted {} with translation key into our components and then we render the page with the translated text for the page's language.  We want to do this on a global scope, not a component to component effort.

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 Kunal_Gaba_

You can make use of Sling Output rewriting pipeline for this use case. There are few examples available for rewriting links in the HTML of a page. You can use the same concept to rewrite the title tag in the HTML. 

https://sling.apache.org/documentation/bundles/output-rewriting-pipelines-org-apache-sling-rewriter.html

https://helpx.adobe.com/experience-manager/using/creating-link-rewrite.html

https://gist.github.com/ryanlunka/5336471

5 replies

Amit_Kumar
Level 10
March 1, 2016

bfvaughn wrote...

Is there a way to transform content authors have entered in a component?  The ask is that we allow the authors to enter a formatted {} with translation key into our components and then we render the page with the translated text for the page's language.  We want to do this on a global scope, not a component to component effort.

 

I believe you can use  bulk editor

https://docs.adobe.com/docs/en/aem/6-1/administer/operations/bulk-editor.html

bfvaughnAuthor
Level 3
March 2, 2016

This use case is more like they want to enter {product_abc} in the Page Title field.  I need to transform the product title to the local of the page.

Kunal_Gaba_
Kunal_Gaba_Accepted solution
March 2, 2016

You can make use of Sling Output rewriting pipeline for this use case. There are few examples available for rewriting links in the HTML of a page. You can use the same concept to rewrite the title tag in the HTML. 

https://sling.apache.org/documentation/bundles/output-rewriting-pipelines-org-apache-sling-rewriter.html

https://helpx.adobe.com/experience-manager/using/creating-link-rewrite.html

https://gist.github.com/ryanlunka/5336471

bfvaughnAuthor
Level 3
March 2, 2016

kunal23 wrote...

You can make use of Sling Output rewriting pipeline for this use case. There are few examples available for rewriting links in the HTML of a page. You can use the same concept to rewrite the title tag in the HTML. 

https://sling.apache.org/documentation/bundles/output-rewriting-pipelines-org-apache-sling-rewriter.html

https://helpx.adobe.com/experience-manager/using/creating-link-rewrite.html

https://gist.github.com/ryanlunka/5336471

 

This is the road I originally went down but didn't see how to get the elements I needed.  Is there a way to get the <p> tags via pipelines?

bfvaughnAuthor
Level 3
March 4, 2016

I think that is the solution but I can't seem to get the raw html to display.