Global component properties | Community
Skip to main content
October 16, 2015
Solved

Global component properties

  • October 16, 2015
  • 2 replies
  • 1516 views

Hi,

I am working on building a footer component for my site. The links on the footer, the logo image and the copyright information on footer are authorable fields.

Since the footer is same across all my templates, I want to edit my footer component, author it once, I want the same links to show across all my pages irrespective of the template being used.

But the way it works currently is:

I have included the footer component in my templates like this <cq:include path="footer" resourceType="proj/components/sitename/footer" /> and also added a design_dialog.

1) When i switch to design mode from the sidekick, and click the edit button on my footer and populate my links, they get stored under:  

/etc/designs/sitename/jcr:content/category-page/footer     for page with template type category-page

/etc/designs/sitename/jcr:content/home-page/footer     for page with template type home-page

2) So I need to author the same set set of links over and over again for each template type once. The site that I am working on has 4 templates, Footer authoring is done 4 times in this case.

3) Any time a new link is added or modified in the footer, it has to be done 4 time to make all page consistent.

Reiterating my question again:

What is the best way to author footer once have the same links show across all the pages irrespective of the template used? or am I doing it the wrong way?

Thanks!

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 rcotta

Just a side note on Scott's reply, as I was having the very same question in here: the complete path is something like:

<cq:include path="footer" resourceType="/path/to/content/node/sitename/footer" />

instead of

<cq:include path="footer" resourceType="proj/components/sitename/footer" />

(note the slash on the beginning of path attribute).

2 replies

Scott_Brodersen
October 16, 2015

In the design_dialog, the path that you are using for storing the dialog values is relative. Try using a complete path, so that all instances use the same node to store/reference the value.

I've never tried this, though.

scott

rcottaAccepted solution
October 16, 2015

Just a side note on Scott's reply, as I was having the very same question in here: the complete path is something like:

<cq:include path="footer" resourceType="/path/to/content/node/sitename/footer" />

instead of

<cq:include path="footer" resourceType="proj/components/sitename/footer" />

(note the slash on the beginning of path attribute).