Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.
SOLVED

How to create multiple image fields in a touch/granite dialog in AEM 6.1

Avatar

Level 2

On the page properties there is a tab for the thumbnail image. I added an additional tab for a background image.

But it seems to be tricky to have multiple image tabs in a dialog.

For the classic/widget based UI I had to explicitly add 'resourceType = foundation/components/image' to the new background image field so it is stored correctly. But now it works for me.

Now I also wanted to add the background image to the touch UI. So I copied the existing definition of the thumbnail image from the granite dialog and added it on a new tab.
But if I open the page properties in the touch UI and add a new image on the thumbnail or background tab,
both tabs always show the same image. In CRX I see that the nodes and properties are mixed up between both image nodes.

This is the code I added to the touch / cq dialog

....
<tabs jcr:primaryType="nt:unstructured">
    <items jcr:primaryType="nt:unstructured">
        <backgroundimage
            cq:showOnCreate="{Boolean}false"
            jcr:primaryType="nt:unstructured"
            jcr:title="Background Image"
            sling:resourceType="granite/ui/components/foundation/section"
            sling:orderBefore="cloudservices">
            <layout
                jcr:primaryType="nt:unstructured"
                sling:resourceType="granite/ui/components/foundation/layouts/fixedcolumns"
                margin="{Boolean}false"/>
            <items jcr:primaryType="nt:unstructured">
                <column
                    jcr:primaryType="nt:unstructured"
                    sling:resourceType="granite/ui/components/foundation/container">
                    <items jcr:primaryType="nt:unstructured">
                        <image1
                            jcr:primaryType="nt:unstructured"
                            sling:resourceType="cq/gui/components/common/wcm/pagethumbnail"
                            page="${empty param.item ? requestPathInfo.suffix : param.item}"
                            quiet="{Boolean}true">
                            <upload
                                jcr:primaryType="nt:unstructured"
                                sling:resourceType="granite/ui/components/foundation/form/fileupload"
                                autoStart="{Boolean}false"
                                cq-msm-lockable="/image1"
                                multiple="{Boolean}false"
                                name="./image1/file.sftmp"
                                sizeLimit="100000000"
                                title="Upload Image"
                                uploadUrl="will_be_replaced"/>
                            <preview
                                jcr:primaryType="nt:unstructured"
                                sling:resourceType="cq/gui/components/siteadmin/admin/pagepreview"/>
                        </image1>
                    </items>
                </column>
            </items>
        </backgroundimage>
        ...

1 Accepted Solution

Avatar

Correct answer by
Level 10

One of our Adobe Touch UI experts stated:

I have this extension for multiple images in a component dialog

http://experience-aem.blogspot.com/2015/06/aem-61-touch-ui-image-multifield.html

Hope this points you in the right direction. 

View solution in original post

2 Replies

Avatar

Employee Advisor

Please see this thread - http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manage... . The solution provided is to install hotfix 6760. I am not sure whether it is still a bug in 6.1 or not. 

Avatar

Correct answer by
Level 10

One of our Adobe Touch UI experts stated:

I have this extension for multiple images in a component dialog

http://experience-aem.blogspot.com/2015/06/aem-61-touch-ui-image-multifield.html

Hope this points you in the right direction.