Search code examples
aemsling

AEM/CQ - Sling script resolution - what script to use?


We have requirement wherein we are required to create some URLs that will be using selectors. The URL that we use currently is

<company>/<domain>/home.html

In addition to the above URL we will be having three more URLs of type:

URL 1 - <company>/<domain>/home.<brand>.html

There can be three possible values of brand. Let's say A, B and C.

Now the template (sling:resourceType --> /apps/components/page/basepage) that <company>/<domain>/home.html uses has sling:resourceSuperType set as foundation/components/page.

/apps/components/page/basepage has only body.jsp.

The body.jsp includes components like footer and header using cq:include. Depending upon the selector used in the URL, some minor changes have to be reflected in the footer and header. Like header image and some text in the footer.

How can I achieve this ?

Thanks in advance


Solution

  • The solution is pretty simple. All we need to do is include the scripts A.jsp, B.jsp and C.jsp under the component nodes. So, that means under the footer and header component nodes. There will be three more jsps now.