Dynamic AEM experience fragment display in HTML/JQuery page

Viewed 450

I have a JSP/jQuery page which has multiple slots to fetch and fill in the contents configured in AEM.

E.g. In an e-com website, a product details page layout with 5 slots, where a banner message and a promotional image in slots 2 & 3 to be fetched from AEM. These are configured as experience fragments in AEM. We need to fetch them and render in the page.

In my JSP, I am able to fetch an individual AEM experience fragment as HTML and render it using import statement like <c:import url="https://www.aemcomponents.dev/content/core-components-examples/library/page-authoring/experience-fragment/_jcr_content/root/responsivegrid/demo_759741754/component/experiencefragment.model.html"> statement.

How can I do the same for dynamic contents - can I pass parameters, like page name and slot id, to fetch fragment HTML configured for the page and slot, as following statement?

<c:import url="https://www.aemcomponents.dev/content/core-components-examples/library/page-authoring/experience-fragment/_jcr_content/root/responsivegrid/demo_759741754/component/experiencefragment.model.html?page=prd&slot=2">

Please help if you have integrated with AEM for similar use case with dynamic experience fragments.

0 Answers
Related