2 Replies Latest reply on Jul 14, 2013 1:36 PM by msulliva

    Multiple images in page properties

    Riju Mahana

      I need to have more images in the page properties, other than the default  "Image". I need this for carousel component.

      I added another image widget using this link :

      https://helpx.adobe.com/cq/kb/CQ5PageProps.html

       

      The problem is that when I add another image widget, even the default on stops working.

      Also, to reuse the default carousel, I'd need to fetch the image using something like:

       

      Resource r = page.getContentResource("image1");

       

      The JCR properties I've used in the new widget are these:

      image-JCR-properties.jpg

      I can see two images saved in the page JCR properties in CRX but the carousel is unable to fetch it .

      Can someone please help me where I am going wrong ?

        • 1. Re: Multiple images in page properties
          msulliva Level 2

          The most glaring issue is that you aren't setting all of the parameter names correctly.  cropParameter, fileNameParameter, fileReferenceParameter, mapParemeter, name, and rotateParameter are all properties that could be set and need to be changed from ./image to ./image1 and also I believe the request suffix needs a tweak.  For me your choice of image1 is not very descriptive, but that's your call.

           

           

          So you would need:

           

           

          "name":"./image1/file",

          "fileReferenceParameter":"./image1/fileReference",

          "requestSuffix":"/image1.img.png",

          "rotateParameter":"./image1/imageRotate",

          "mapParameter":"./image1/imageMap",

          "cropParameter":"./image1/imageCrop",

          "fileNameParameter":"./image1/fileName"

           

           

          Another interesting thing and something I didn't notice changed in CQ 5.5 or AEM 5.6, but they used to have the basic tab create the image tab(s) as a separate components by setting a sling:resourceType for them, which I suppose you could still do.  This may or may not be your problem, but you used to be able to do this:

           

           

          http://localhost:4502/content/geometrixx/en/events/shapecon/jcr:content/image.html and the image would render because it had a sling:resourceType of "foundation/components/image" which would show the image, now you get a 404.

           

           

          So on the old version, the tab_basic/items had after vanity another node of imgResType, and for your case I added one for your image1 with:

           

           

          "imgResType":{

              "xtype":"hidden",

              "name":"./image/sling:resourceType",

              "value":"foundation/components/image",

              "ignoreData":true,

              "jcr:primaryType":"cq:Widget"

          },

          "img1ResType":{

              "xtype":"hidden",

              "name":"./image1/sling:resourceType",

              "value":"foundation/components/image",

              "ignoreData":true,

              "jcr:primaryType":"cq:Widget"

          }

           

          So to clarify, your page/tab_basic would have items:

           

          basic

          more_titles

          onofftime

          vanity

          imgResType

          img1ResType