I have two components in separate pages. I want to show the authored data of component 1 in component 2. Is there someway we can achieve this without the creation of a content api? If possible is it possible to pull the entire htl of component 1 in component 2?
Preferably using HTL itself?
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
Short answer: No, each component will store its content (configs/data) individually, so it is not shareable. However, there are several ways to accomplish this. One approach is to have a "source of truth" from which you can pull data to feed into Component 1 or Component 2. You could retrieve this data using a Sling Model, API, OSGi Service, etc.
Taking this approach involves several considerations, such as where to store the data, what types of structures to use, and who will have access. If you choose this route, you might also explore Content Fragments, which can help you determine where and how to store content for consumption.
Depending on the relationship between Component 1 and Component 2 in the content tree, there may be additional options to explore for inheriting properties that may also be accessible through HTL, you can see more in the references section at the bottom.
Another option is to use Experience Fragments (XF), which can be reused across pages. You can also check if the variations concept works for you.
There is no definitive answer, as the decision should be based on your specific requirements and needs.
Here are some references that you can take a look:
- https://medium.com/@veena.vikraman19/inherit-properties-from-parent-pages-in-aem-9ab41f9d98dc
Hope this helps
Hi @Zendarkke ,
Use experience fragment in this scenario so that you can drive content display at multiple places from single source.
Thanks
Hi,
Short answer: No, each component will store its content (configs/data) individually, so it is not shareable. However, there are several ways to accomplish this. One approach is to have a "source of truth" from which you can pull data to feed into Component 1 or Component 2. You could retrieve this data using a Sling Model, API, OSGi Service, etc.
Taking this approach involves several considerations, such as where to store the data, what types of structures to use, and who will have access. If you choose this route, you might also explore Content Fragments, which can help you determine where and how to store content for consumption.
Depending on the relationship between Component 1 and Component 2 in the content tree, there may be additional options to explore for inheriting properties that may also be accessible through HTL, you can see more in the references section at the bottom.
Another option is to use Experience Fragments (XF), which can be reused across pages. You can also check if the variations concept works for you.
There is no definitive answer, as the decision should be based on your specific requirements and needs.
Here are some references that you can take a look:
- https://medium.com/@veena.vikraman19/inherit-properties-from-parent-pages-in-aem-9ab41f9d98dc
Hope this helps
Views
Likes
Replies