How to use a simple HTML component dynamically
I created a simple HTML component also I entered the embed google map HTML iframe script, But i have to use in dynamically in multiple pages. Could you please suggest a way.
I created a simple HTML component also I entered the embed google map HTML iframe script, But i have to use in dynamically in multiple pages. Could you please suggest a way.
Hi @sanzstark ,
One of the easiest way to do this to create an content wrapper/include component that uses data-sly-resource to render the resource and take resource path(page path) as an input.

You had to create an page with just your map iframe in AEM and pass the page path to the wrapper/include component. You can either include(path/to/resource) till resource at root(can be useful for the rendering other pages content Disadvantage: Components becomes authorable in the wrapper/include component) or at the component level(yours's map iframe component resource path Advantage: Component is not authorable in wrapper/include components). You can customize the same as per your requirements.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.