Expand my Community achievements bar.

SOLVED

Content Transformer

Avatar

Level 3

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.

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

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....

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

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

View solution in original post

5 Replies

Avatar

Level 10

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

Avatar

Level 3

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.

Avatar

Correct answer by
Employee Advisor

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....

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

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

Avatar

Level 3

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....

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?

Avatar

Level 3

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