Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Product Selector in Metadata Schema

Avatar

Level 2

Hey guys,

 

I'm attempting to add a field to the "default" metadata schema . I've read the documentation here https://experienceleague.adobe.com/docs/experience-manager-64/assets/administer/metadata-schemas.htm... , but I want the field that I'm adding to mimic the functionality of the default "Product Skus." field under the commerce tab (picture attached). Said "Product Skus." field appears as a Text Field in the gui, but obviously there is some functionality under the hood allowing the user to select from a list of products. Is this functionality possible to duplicate in a custom field? Or is there some place in CRX I can look to see how the "Product Skus." field operates? 

 

product-skus.PNG

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

You need to add metadata schema here, you can add clientlibs also 

/conf/global/settings/dam/adminui-extension/metadataschema

e.g.

<tab5 granite:rel="aem-assets-metadata-form-tab"
                    jcr:primaryType="nt:unstructured"
                    jcr:title="Commerce"
                    sling:resourceType="granite/ui/components/coral/foundation/container"
                    listOrder="4">
                    <granite:data jcr:primaryType="nt:unstructured"
                        tabid="dd9d71ff-4524-435d-a16c-0249020660fc" />
                    <items jcr:primaryType="nt:unstructured">
                        <tabs jcr:primaryType="nt:unstructured"
                            sling:resourceType="granite/ui/components/coral/foundation/include"
                            path="/apps/myproj/dam/metadata/accesscontrol/tabs" />
                        <clientlibs jcr:primaryType="nt:unstructured"
                            sling:resourceType="granite/ui/components/coral/foundation/includeclientlibs"
                            categories="myproj.dam.metadataeditor.commerce" />
                    </items>
                </tab5>

View solution in original post

3 Replies

Avatar

Community Advisor

Hi,

Technically, it is possible to reuse the logic for assets as well.

You can create the metadata schema using granite types and can check the logic for Product SKU and write the same code/could be a small piece of code to make a request to some API. 

but it is possible. 

I did something similar but not for the products.

Avatar

Level 2

Hey Arun,

 

Thanks for your response -- where did your xml end up living in CRX? I'm having some trouble tracking that down haha...

Avatar

Correct answer by
Community Advisor

You need to add metadata schema here, you can add clientlibs also 

/conf/global/settings/dam/adminui-extension/metadataschema

e.g.

<tab5 granite:rel="aem-assets-metadata-form-tab"
                    jcr:primaryType="nt:unstructured"
                    jcr:title="Commerce"
                    sling:resourceType="granite/ui/components/coral/foundation/container"
                    listOrder="4">
                    <granite:data jcr:primaryType="nt:unstructured"
                        tabid="dd9d71ff-4524-435d-a16c-0249020660fc" />
                    <items jcr:primaryType="nt:unstructured">
                        <tabs jcr:primaryType="nt:unstructured"
                            sling:resourceType="granite/ui/components/coral/foundation/include"
                            path="/apps/myproj/dam/metadata/accesscontrol/tabs" />
                        <clientlibs jcr:primaryType="nt:unstructured"
                            sling:resourceType="granite/ui/components/coral/foundation/includeclientlibs"
                            categories="myproj.dam.metadataeditor.commerce" />
                    </items>
                </tab5>