How to reuse created component resources to render a page | Community
Skip to main content
Level 2
February 18, 2016
Solved

How to reuse created component resources to render a page

  • February 18, 2016
  • 5 replies
  • 1200 views

I add a component in one page. For instance, I drag and drop a Text & Image component.I edit that component with some texts and an image. Now, I need to reuse that created Text & Image component resource to render another page so that the same content can display automatically when the second page opens.There should be an easy way to achieve that, but I didn't figure it out. Any helps?

Thanks and regards,

Yy

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by edubey

You can use OOTB reference component, drag this component where you want to refer previous author component

Take a look @ https://docs.adobe.com/docs/en/cq/5-6/wcm/default_components.html#Reference

5 replies

edubey
edubeyAccepted solution
Level 10
February 18, 2016

You can use OOTB reference component, drag this component where you want to refer previous author component

Take a look @ https://docs.adobe.com/docs/en/cq/5-6/wcm/default_components.html#Reference

smacdonald2008
Level 10
February 18, 2016

As Praveen pointed out - you can use the Reference component. BUt if you do this and make a change - the change appears in the other page. When authoring pages - i prefer a 1-1 model. Each page has its own component so a change made in page 1 will not affect page 2. 

y_12Author
Level 2
February 18, 2016

Is it possible to load created resources programmatically without manually dragging components to the pages? The page will dynamically display the component content based on the backend business logic.

Thanks,

Yy

edubey
Level 10
February 18, 2016

You can use

<cq:include path="path to your component node" resourceType="script that will render the componet example [1]" />

[1] apps/project/component/text

y_12Author
Level 2
February 18, 2016

Yeah, that's exactly what I need. Thank you and Scott very much for your help.

Yy