RTE- How to add dynamic values in between content | Community
Skip to main content
Level 3
October 16, 2015
Solved

RTE- How to add dynamic values in between content

  • October 16, 2015
  • 3 replies
  • 2888 views

Hi All,

I have an requirement which need expertise suggetions to implement the same. The requirement is as follows

The Content which has to be added to the page has dynamic values like User ID's which fetch from other systems. if I use RTE can i able to do that. how to identify the dynamic values.

Example Content: "welcome to my company. you are shortlisted for the lucky draw. The user id allocated for you is XXXXX and agreement number is XXXXX"

Please let me know how to handle these kind of situations like editor has to update content where in between dynamic values will be present

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 Runal_Trivedi

Approach 1:

RTE has got a plugin called InsertVariablePlugin, it pretty much does the same, inserts the dynamic values in RTE content.

2 OOTB RTE configuration examples you can refer to:

  1. /libs/mcm/components/newsletter/footer/dialog/items/text/rtePlugins/insertvariable/variables
    • It is newsletter text component.
  2. /libs/mcm/components/newsletter/footer/dialog/items/text/rtePlugins/insertvariable/variables/givenName
    • It is newsletter footer component.

More on InsertVariablePlugin can be found on widget API page - http://dev.day.com/docs/en/cq/current/widgets-api/index.html

But I guess they refer dynamic values only from logged in users profile so you might need to extend it.

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Approach 2:

  • We had similar requirement but we did not want to extend InsertVariablePlugin to inject dynamic values. So what we did; while defining content of RTE we inserted dynamic text with placeholders like - $$Dynamic_Val_1$$
  • Before rendering the RTE content, we wrote the wrapper function to rewrite the dynamic values with the actual content we need. Basic String replace in java function.

See if any of the approach suits you.

- Runal

3 replies

Sham_HC
Level 10
October 16, 2015

If you are with aem6 look at adobe campaign & aem integration. It has what you need.

http://www.adobe.com/news-room/pressreleases/201401/011414AdobeCampaignIntegration.html

KishCq5Author
Level 3
October 16, 2015

Thanks for your reply shyam. Currently i am using Adobe CQ5.5 . Please suggest.

Runal_Trivedi
Runal_TrivediAccepted solution
Level 6
October 16, 2015

Approach 1:

RTE has got a plugin called InsertVariablePlugin, it pretty much does the same, inserts the dynamic values in RTE content.

2 OOTB RTE configuration examples you can refer to:

  1. /libs/mcm/components/newsletter/footer/dialog/items/text/rtePlugins/insertvariable/variables
    • It is newsletter text component.
  2. /libs/mcm/components/newsletter/footer/dialog/items/text/rtePlugins/insertvariable/variables/givenName
    • It is newsletter footer component.

More on InsertVariablePlugin can be found on widget API page - http://dev.day.com/docs/en/cq/current/widgets-api/index.html

But I guess they refer dynamic values only from logged in users profile so you might need to extend it.

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Approach 2:

  • We had similar requirement but we did not want to extend InsertVariablePlugin to inject dynamic values. So what we did; while defining content of RTE we inserted dynamic text with placeholders like - $$Dynamic_Val_1$$
  • Before rendering the RTE content, we wrote the wrapper function to rewrite the dynamic values with the actual content we need. Basic String replace in java function.

See if any of the approach suits you.

- Runal