I have a bit of a thorny issue.
I have a component (we'll call it trouble-component) that is configured only once on a page, let's say the home page.
The presence of the component in that page is overridden with data-sly-resource in the structure (we'll call it generic structure) that is used by that very page (home page and many other pages), so that each page using that structure will contain that resource which was added to the home page in a fashion similar to the following:
<sly data-sly-resource="${'/content/path-to-homepage/jcr:content/trouble-component' @ resourceType='my-project/components/content/trouble-component'}"></sly>
This produces the desired outcome, which is that:
Now the issue.
Due to the way this is configured, the only page node containing (in its jcr:content, or below) the trouble-component is the home page and when I use a Model Exporter to map and export the properties of the other pages which use generic structure, even though the page itself will contain the trouble-component, it's corresponding JCR node will not, so that - and this is the issue - the Model Exporter will not expose the content of trouble-component when exporting/mapping any other page that is not home page.
How can I - when exporting the JCR representation of the node of a page (via Sling Model Exporter, for example, or in any other way) that extends generic structure and thus will contain the trouble-component, export the configuration of the trouble-component that is centralized in the home page?
I realize this is a bit of a thorny question and I hope I have made myself clear.
If a more appropriate architecture is to be contemplated in order to:
I am more than willing to contemplate a different solution.
In the meantime, I am grateful for whatever input, advice or insight you'll be able to provide,
Parag Dalal.
Solved! Go to Solution.
Views
Replies
Total Likes
If I understand you correctly, some external logic (outside of the trouble-component) know where to get that content for that trouble-component from. But this logic is not reflected in the Sling-Model-Exporter, because SME does not know anything about that specific logic.
If my assumption is correct, I see the problem in the fact, that the functioning of this component depends on many different aspects working together (the external logic, the trouble-component, and now also the SME). In your case I would concentrate all the logic into the trouble-component. Instead of some external logic writing that data-sly statement with the correct resource path, add this logic to the trouble-component, and then you handle that inclusion also when the SME is exporting the model for the trouble-component.
Does that make sense?
The one of the approaches is to change the component model and read the trouble-component resource from home page and expose via sling-model-exporter
http://www.sgaemsolutions.com/2017/06/sling-model-exporter-in-aem-63.html
If I understand you correctly, some external logic (outside of the trouble-component) know where to get that content for that trouble-component from. But this logic is not reflected in the Sling-Model-Exporter, because SME does not know anything about that specific logic.
If my assumption is correct, I see the problem in the fact, that the functioning of this component depends on many different aspects working together (the external logic, the trouble-component, and now also the SME). In your case I would concentrate all the logic into the trouble-component. Instead of some external logic writing that data-sly statement with the correct resource path, add this logic to the trouble-component, and then you handle that inclusion also when the SME is exporting the model for the trouble-component.
Does that make sense?
Hi @parag_dalal ,
The component you are refering to "trouble component" is to be configured only once and then to be used in all the pages. You can achieve such a usecase with experience fragment. You can configure such components on experience fragments and include the experience fragment component on the structure of page so that it appears on all pages.
Here are the useful refrences to understand experience fragments:
https://docs.adobe.com/content/help/en/experience-manager-learn/sites/experience-fragments/experienc...
Hope it helps!
Nupur
Views
Like
Replies