Expand my Community achievements bar.

SOLVED

In AEM 6.3, how to re-use component content on multiple pages

Avatar

Level 4

In AEM 6.3, I have "List component" which has already been authored on the page. Is there any way we can use the same component content on some other page without dragging-and-dropping the List component again. Basically, we would like to re-use the same component data on other pages without re-authoring just to save time and effort. Any pointers will be highly appreciated.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Inheritance

it is implemented by components like the iparsys or by using the InheritanceValueMap of Sling. In this case the reference target is always the parent (page/node). This approach is helpful when you want to inherit content down the tree (e.g from the homepage of the site to all individual pages); with the iparsys it’s hte content of a parsys, with the InheritanceValueMap it’s properties.

e.g. https://javaecm.com/tag/iparsys/

Reference

it is implemented by data-sly-resource attribute in HTL similar to sling include, this includes the result of rendering the indicated resource through the sling resolution and rendering process.

e.g.

<article data-sly-resource="${ @ path='path/to/resource'}"></article>

more info

https://docs.adobe.com/content/help/en/experience-manager-htl/using/htl/block-statements.html



Arun Patidar

View solution in original post

6 Replies

Avatar

Community Advisor

yes, you can convert that component(s) into experience fragment and reuse the content.

Adobe Experience Manager Help | Using AEM Experience Fragments

Experience Fragments 



Arun Patidar

Avatar

Level 4

Hi Arun - I don't want to use the experience fragment. Is there any other way?

Avatar

Community Advisor

Hi,

You can reuse the content in the following way in AEM:

  • By Reference
  • By inheritance
  • Content Fragments and Experience Fragments.
  • own implementation - for example, you can author list component in a page say list-container-page and author list. In your list component sightly code you write a logic to pick content from this authored list from list-container-page. if this page is not available or node is noted available then it picks content from the authored list in the current page.
    There could be other approaches based on your use case and architecture.



Arun Patidar

Avatar

Level 4

I understand Content Fragments and Experience Fragments and custom implementation too. Can you please put some more context on below too. If possible please share some examples.

  • By Reference
  • By inheritance

Avatar

Correct answer by
Community Advisor

Inheritance

it is implemented by components like the iparsys or by using the InheritanceValueMap of Sling. In this case the reference target is always the parent (page/node). This approach is helpful when you want to inherit content down the tree (e.g from the homepage of the site to all individual pages); with the iparsys it’s hte content of a parsys, with the InheritanceValueMap it’s properties.

e.g. https://javaecm.com/tag/iparsys/

Reference

it is implemented by data-sly-resource attribute in HTL similar to sling include, this includes the result of rendering the indicated resource through the sling resolution and rendering process.

e.g.

<article data-sly-resource="${ @ path='path/to/resource'}"></article>

more info

https://docs.adobe.com/content/help/en/experience-manager-htl/using/htl/block-statements.html



Arun Patidar

Avatar

Level 10

That will get messy as each page has its own props that populate the components.  If you want to use same content on other pages - you should look at EFs or even Content Fragments - not try and reuse a component set in Page A on Page B.