3 Replies Latest reply on Apr 17, 2013 3:30 AM by CQDarren

    sling:ResourceSuperType foundation/components/page

    CQDarren

      Hi Everybody,

       

      I'm new to CQ and really enjoying it.  I have a question if someone can please help?

       

      Can anyone help me understand how sling resolves a page component that has a resourceSuperType of  foundation/components/page ?  I created a page structure similar to the geometrixx pages, and have the following page component.

       

      components/page/contentpage

      body.jsp

      content.jsp

      footer.jsp

      header.jsp

       

      Therefore I discovered that I can override the body.jsp as this is the page selected by sling (I originally had contentpage.jsp).  Also using this structure I understand that if I have another template and page component I just extend the above "contentpage" component and override "content.jsp" keeping my web site structure (Nice!).

       

      But what I don't understand is how how sling resolves to the body.jsp as the preferred script in the first place? Can anyone help me understand?

       

      Thanks

      Darren

        • 1. Re: sling:ResourceSuperType foundation/components/page
          Black Nike

          Hi Darren,

           

          I guess you can find some clue in the .content.xml in your components/page/contentpage directory, the "sling:resourceSuperType" should be "yourprojectname/component/page" which means your contentpage is implemented from "yourprojectname/component/page".

           

          Then check the .content.xml file in "yourprojectname/component/page" directory, the "sling:resourceSuperType" should be "foundation/components/page".

           

          Now you can check "libs/foundation/components/page/page.jsp" there's a <cq:include script="body.jsp"/>. To my understand, sling is resolving "page.jsp" as the script, and page.jsp includes the body.jsp.

           

           

          Good luck!

          • 2. Re: sling:ResourceSuperType foundation/components/page
            Black Nike Level 1

            Or forget about the .content.xml,  you can also use CRXDE lite to check the sling:resourceSuperType, it is a property of your "contentpage" node.

            • 3. Re: sling:ResourceSuperType foundation/components/page
              CQDarren Level 1

              Hi Black Nike,

               

              Yes this looks good and I think I understand it now!.  By extending the page component (sling:resourceSuperType) the page.jsp is selected from “foundation/component/page” which contains “cq:includes of head.jsp and body.jsp”.  Therfore I see CQ looks in apps and then libs for those scripts - effectively letting us extends them.  Please correct me if I am wrong.

               

              Thank you very much for taking the time to respond!

               

              Darren.