Referencing a content node from within a component
Hi, all.
We're working on a site that will have some components with HTML fragments that will be re-used across dozens (maybe hundreds) pages. And the requirement is that I edit a fragment once, and this change reflects to all pages that are using it.
I could achieve this by placing a call on my template's jsp file with an absolute path attribute, like call below:
<cq:include path="/content/shared/HTMLTextFooter" resourceType="project-name/components/html-text"/>
But our requirement is a little bit more sophisticated: we should be able to, from the custom component (for which I am asking advice to develop) reference an existing node with content for this component. In other words, I think I should be able to inform the path "/content/shared/HTMLTextFooter" somehow on the edit window.
I know we can create N components with distinct jsp render files, each one pointing to a specific path, but this will lead us to the problem of creating a new component and deploying a package every time a re-usable fragment is identified.
Could you please share your insights/previous experiences regarding the scenario/questions above?