2 Replies Latest reply on Jul 8, 2013 12:25 AM by Sunil Chowdhary

    How can I include coltrl in a template?

    BearCherian Level 1

      I want to include a colctrl component in my template. I could include a parsys that has the colctrl component enabled and it's specific layouts defined in the design, but then that leaves the users the ability to add items outside of the colctrl.

       

      My approach is to include the colctrl directly on the template with a cq:include.

      <cq:include path="banner" resourceType="foundation/components/parsys/colctrl" />
      


      When I do this, I am able see the components edit bar on the page, and I can select the layouts as needed, but it doesn't generate the parsys_column areas to add content.

       

      Is there another approach I should try? Is there another way to accomplish this? The idea here is to give the user options on the way the columns are laid out in this section, but not be able to add anything outside of these columns.

        • 1. Re: How can I include coltrl in a template?
          FernTeles

          The best way to do this os edit your template node do receive a colctrl. An example:

           

           

          <?xml version="1.0" encoding="UTF-8"?>

           

          <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"

              jcr:description="Page with a parsys"

              jcr:primaryType="cq:Template"

              jcr:title="Page with a parsys"

              allowedPaths="[/content(/.*)?]"

              ranking="{Long}100">

           

              <jcr:content

                  jcr:primaryType="cq:PageContent"

                  sling:resourceType="fiat-portal/containers/empty-container">

           

                  <banner

                      jcr:primaryType="nt:unstructured"

                      sling:resourceType="foundation/components/parsys">

           

                      <colctrl

                          jcr:created="{Date}2013-07-05T11:06:16.396-03:00"

                          jcr:createdBy="admin"

                          jcr:lastModified="{Date}2013-07-05T11:06:16.396-03:00"

                          jcr:lastModifiedBy="admin"

                          jcr:primaryType="nt:unstructured"

                          sling:resourceType="foundation/components/parsys/colctrl"

                          controlType="start"

                          layout="2;cq-colctrl-lt0"/>

           

           

               </banner>

           

              </jcr:content>

          </jcr:root>

           

           

          The colctrl needs to be inside a parsys component. The template node "page" in the geometrix-outdoors, (/apps/geometrixx-outdoors/templates/page) is an example of a template with columns.

          • 2. Re: How can I include coltrl in a template?
            Sunil Chowdhary Level 1

            The approach followed seems to be fine.

             

            The code generation happens in file :

             

            /libs/foundation/components/parsys/parsys.jsp

             

            We can debug this file to find out the possible reason.