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
--base-page (sling:resourceSuperType as foundation/components/page)
-- inner-page (sling:resourceSuperType as base-page)
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?
Just few questions
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):
There is also a video.
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:
Handler of component is invalid -> SyntaxError: Unexpected token ) at Object.ns.util.sanitizeCQHandler () at String.<anonymous> ( ) at Function.each ( ) at constructor._loadConfig ( ) at constructor.updateConfig ( ) at at Array.forEach (native) at Array.ns.editables.self.add ( ) at Object.<anonymous> ( ) at fire ()
Sample package available at:
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.
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.
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.