Skip to main content
Level 3
Mar 1, 2016 9:46 PM UTC
Solved

Content Transformer

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.
Kunal_Gaba_
Kunal_Gaba_Accepted solution
New Member
Mar 2, 2016 12:18 AM UTC

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
Mar 1, 2016 11:24 PM UTC

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

Translate
bfvaughnAuthor
Level 3
Mar 2, 2016 12:04 AM UTC

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.

Translate
Kunal_Gaba_
Kunal_Gaba_Accepted solution
New Member
Mar 2, 2016 12:18 AM UTC

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

Translate
bfvaughnAuthor
Level 3
Mar 2, 2016 1:59 PM UTC

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?

Translate
bfvaughnAuthor
Level 3
Mar 4, 2016 1:55 PM UTC

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

Translate