Expand my Community achievements bar.

In a component when you find a tag whit a text in an AEM component.

Avatar

Level 1

I will like to have the possiblity to have my component to replace the tag whit a text 

For example: "this is a [tag] text"  (tag=normal ) 

in "this is a normal text " , i can replace the string and take the data from a content fragment but i'm not able to modify the text in a component 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Reply

Avatar

Community Advisor

Hi, 

You could use a Sling Model to manually perform the replacement. Simply put, in the Sling Model, look for the property that contains the "[tag]" and replace it with any other value you need. Then return the new value and use it in your HTL.


Here you have an example of a sling model that can be useful: https://sourcedcode.com/blog/aem/how-to-pass-parameters-to-sling-modal-from-sightly-htl-component 


Hope this helps.



Esteban Bustamante