Issue with sling:resourceSuperType AEM 6.3

Avatar

Avatar

anujk4

Avatar

anujk4

anujk4

01-06-2017

Hi,

We are in process of upgrading from AEM 6.0 to AEM 6.3. We also wanted to use sightly for our existing code base. We are converting the existing templates and components as per sightly.

Templates use sling:resourceSuperType to inherit from page component provided OOB

e.g:

--apps

     --myProject

          --components

               --pages

                    --base-page (sling:resourceSuperType as foundation/components/page)

                         -- body.jsp

                         --head.jsp

                         --content.jsp

                         --headlibs.jsp

                         --navigation.jsp

                    -- inner-page (sling:resourceSuperType as base-page)

                         -- content.jsp

                         -- headlibs.jsp

This is done to inherit common content in new templates created and the changes are specified in jsp files added to the new template.

While creating the page using the 'inner-page' template, content.jsp and headlibs.jsp are loaded from inner-page and rest of the items on the page are loaded from files as placed under the base-page because of sling:resourceSuperType used.

Now AEM 6.3,

1. base-page sling:resourceSuperType changed to wcm/foundation/components/page

2. all the jsp's mentioned above are changed to .html

3. code changes done as per sightly.

Now if we create a page using 'inner-page' template, the page is displayed blank. if we change the filename under /inner-page/content.html to /inner-page/inner-page.html, the page displays the content as per the inner-page.html. But the content from /base-page are not loaded despite using the sling:resourceSuperType as /apps/myProject/components/pages/base-page

What is it that we are doing wrong here in using sling:resourceSuperType?

Replies

Avatar

Avatar

Feike_Visser1

Employee

Avatar

Feike_Visser1

Employee

Feike_Visser1
Employee

01-06-2017

Any package you can share?

Avatar

Avatar

Veena_Vikram

MVP

Avatar

Veena_Vikram

MVP

Veena_Vikram
MVP

01-06-2017

Hi Anuj

       Just few questions

  1. When you create a page using base page template, is it loading properly ?
  2. Assuming the answer to the above question is yes, does your base-page's body.html has a proper content.html include , something like this <sly data-sly-include="content.html"></sly> ? If this include is not present in this way, it will not look for the content.html from inner-page (using the sling resolution principles) when you create a page out of that template
  3. Will it be possible to share the sample code as Feike mentioned, so that we can have a look to see what the real issue could be if both the above steps are working fine

Thanks

Veena

Avatar

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Reply

2.3K

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Reply

2.3K
smacdonald2008

01-06-2017

For AEM 6.3 - check this article for some tasks that may help you. It breaks down all site sections in different pieces and uses HTL (Sightly proper name):

Scott's Digital Community: Creating your First Adobe Experience Manager 6.3 website

There is also a video.

Avatar

Avatar

anujk4

Avatar

anujk4

anujk4

01-06-2017

Hi All,

I think i got the issue with the sling:resourceSuperType issue.

1. existing head.html is not in sync with the head.html available as part of wcm/foundation/components/page. There are loads of changes and i would need to refactor head.html and headlibs.html.

There is one issue that will slow down our process of changing to sightly. as a temporary fix for the issue above, i have replaced the head.html and headlibs.html with the file at wcm/foundation/components/page. the template is displayed fine now. but if i try to drop any component on the page, i get the errors in dev console. Can you tell me if this is something missing in the template or it has something to do with the component? we are refactoring the components as well. Below is the error log:

core.js:20351 Handler of component is invalid -> SyntaxError: Unexpected token ) at Object.ns.util.sanitizeCQHandler (http://localhost:4504/libs/cq/gui/components/authoring/editors/clientlibs/core.js:6846:39) at String.<anonymous> (http://localhost:4504/libs/cq/gui/components/authoring/editors/clientlibs/core.js:8592:67) at Function.each (http://localhost:4504/etc.clientlibs/clientlibs/granite/jquery.js:376:19) at constructor._loadConfig (http://localhost:4504/libs/cq/gui/components/authoring/editors/clientlibs/core.js:8561:15) at constructor.updateConfig (http://localhost:4504/libs/cq/gui/components/authoring/editors/clientlibs/core.js:8640:22) at http://localhost:4504/libs/cq/gui/components/authoring/editors/clientlibs/core.js:28071:26 at Array.forEach (native) at Array.ns.editables.self.add (http://localhost:4504/libs/cq/gui/components/authoring/editors/clientlibs/core.js:28060:23) at Object.<anonymous> (http://localhost:4504/libs/cq/gui/components/authoring/editors/clientlibs/core.js:21909:46) at fire (http://localhost:4504/etc.clientlibs/clientlibs/granite/jquery.js:3232:31)

Sample package available at:

https://drive.google.com/open?id=0Bxiqz8e_g7ACWUFWMW5FRWpfcmc

Avatar

Avatar

anujk4

Avatar

anujk4

anujk4

01-06-2017

Hi Veena,

Thanks for the reply. i could see the error message if i switch to Developer mode from the touch UI. there was some issue with head.html that was messing up the resource Super Type declaration. I removed head.html and it worked fine.

Now facing a new issue. i have posted a reply to main thread. It would be wonderful if a you can point us in the right direction. We are not sure if this is something missing in template or it component issue.

Thank You So much for all the help.

Avatar

Avatar

puradawid

Avatar

puradawid

puradawid

01-06-2017

Unfortunately, includes are defined with extension, so that if generic page template went to html that will cause those jsp files won't be included.

What you can do ASAP is just creating those files with jsp you have (that are overriding base page) with html extension and just simply load JSP as include, like:

<sly data-sly-include="your-file.jsp" />

But you have to check that base page is having same structure as it had previously.

Avatar

Avatar

Veena_Vikram

MVP

Avatar

Veena_Vikram

MVP

Veena_Vikram
MVP

02-06-2017

Hi Anuj

     I am checking the code now. I will get back once I figure out the cause

Thanks

Veena

Avatar

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Reply

2.3K

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Reply

2.3K
smacdonald2008

02-06-2017

Did you refer to this document  - it shows you how to build a site using HTL syntax --

Adobe Experience Manager Help | Creating your First Adobe Experience Manager 6.3 website

Avatar

Avatar

Veena_Vikram

MVP

Avatar

Veena_Vikram

MVP

Veena_Vikram
MVP

02-06-2017

Hi Scott

          I could see that they have followed the same structure. But basically they are trying to rewrite the existing code and hence could be having some issues in the code which is breaking their pages.

Thanks

Veena