Expand my Community achievements bar.

SOLVED

Reusability of same authored component

Avatar

Level 2

So I want to refer to the component which we have created as part of one of the pages and render the same content with the same authored data on another page, how can this be achievable?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

For different approach, follow the below steps

  1. Create a data page and create component with all the fields that needs to be reused
  2. Create a custom components with pathbrowser, configure that to the data page
  3. Read the resource in the custom components and inject the resource properties
  4. Apply styles and conditions required for the custom component and display the values from datapage.

Hope this is helpful

View solution in original post

9 Replies

Avatar

Level 2

Thank you for your comment.

But I am not looking for an experience fragment way, Any other suggestion would be much appreciated.

Avatar

Community Advisor

if not with experience fragments, you'll have to deal with this in a complex way.

At the moment I could think of creating a data node where you have all the content in the jcr:content properties – from your custom component read these properties from the node from your sling model and display them on dragging it. The only thing here is you figure out how you wanna author this data node.

I would still recommend using Experience Fragments to keep it simple and author-friendly.

Avatar

Community Advisor

Create an experience fragment page and configure the required component on that page.

Then configure the experience fragment component where ever it is required and same content is displayed at all the places where it configured.

Please refer this documentation for information on Experience fragments.

https://experienceleague.adobe.com/docs/experience-manager-64/authoring/authoring/experience-fragmen...

Hope this is helpful

Avatar

Level 2

Thank you for your comment.

But I am not looking for an experience fragment way, Any other suggestion would be much appreciated.

Avatar

Employee Advisor

Earlier AEM had Reference Paragraph [1] component, which was removed from the Touch UI interface, and AEM Introduced a more flexible way to manage and use shared content, called Experience Fragments [2].

You should create xFragments for the content that is reusable, and use the Experience Fragment core component [3] on your page to refer to experience fragment.

[1] https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/touch-ui-paragraph-referen...

[2] https://experienceleague.adobe.com/docs/experience-manager-learn/sites/experience-fragments/experien...

[3] https://experienceleague.adobe.com/docs/experience-manager-core-components/using/wcm-components/expe...

Avatar

Level 2

Hi @Mohit_KBansal ,

Thank you for your comment.

But I am not looking for an experience fragment way, Any other suggestion would be much appreciated.

Avatar

Community Advisor

Hi @Mohit1

If you are not looking for an experience fragment way, I would recommend you to use the content fragment.

Refer :- Adobe Experience Manager Help | Working with Adobe Experience Manager Content Fragments

Thanks

Avatar

Correct answer by
Community Advisor

For different approach, follow the below steps

  1. Create a data page and create component with all the fields that needs to be reused
  2. Create a custom components with pathbrowser, configure that to the data page
  3. Read the resource in the custom components and inject the resource properties
  4. Apply styles and conditions required for the custom component and display the values from datapage.

Hope this is helpful