Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Global component properties

Avatar

Level 1

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!

1 Accepted Solution

Avatar

Correct answer by
Level 2

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).

View solution in original post

2 Replies

Avatar

Level 8

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

Avatar

Correct answer by
Level 2

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).