Product Selector in Metadata Schema | Community
Skip to main content
Level 2
April 20, 2022
Solved

Product Selector in Metadata Schema

  • April 20, 2022
  • 1 reply
  • 797 views

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.html?lang=en , 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? 

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by arunpatidar

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>

1 reply

arunpatidar
Community Advisor
Community Advisor
April 20, 2022

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.

Arun Patidar
user00928Author
Level 2
April 20, 2022

Hey Arun,

 

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

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
April 21, 2022

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>
Arun Patidar