Hi,
I would like to create a target component (sling:resourceType should be cq/personalization/components/target) programmatically.
My scenario is as follows:
- I have a par component_A that has a rendering file component_A.html. This HTML render file calls a JSP file using the following sightly statement
<sly data-sly-include="componentCreator.jsp" data-sly-unwrap />
- the included "componentCreator.jsp" should then create a target component and pass it to component_A
Does anybody know how to achieve this? Any help would be appreciated.
Regards, Abou
Solved! Go to Solution.
Views
Replies
Total Likes
add a node with a sling:resourceType 'cq/personalization/components/target' programatically similar to other nodes. This creates a target component
Under this, you can create a node by name 'default' with the sling:resourceType mapping to your component would get the default content to it.
Views
Replies
Total Likes
Hi Abdoulaye,
what you have provided above is the technical requirements. What are you business requirements for this functionality?
Regards,
Opkar
Views
Replies
Total Likes
Views
Replies
Total Likes
Hi Opkar,
the business requirement is to place target components on dynamically generated websites and then later decide via business logic if a special offer should be displayed at the target component or not.
The main reason why i need this functinality is that the websites are generated automatically and contains several <div> elements in which a special offer can be displayed or not according to a current campaign.
Thanks in advance for your help
Views
Replies
Total Likes
add a node with a sling:resourceType 'cq/personalization/components/target' programatically similar to other nodes. This creates a target component
Under this, you can create a node by name 'default' with the sling:resourceType mapping to your component would get the default content to it.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies