Adding custom fields in Assets and displaying it in MAgnolia CMS Frontend

25 views Asked by At

I have created two new meta fields in assets using following code in decorations> dam-assets-app>apps>dam.yaml

subApps:
  jcrDetail:
    form:
      properties:
        imageCredit:
          $type: textField
          label: Image Credit
          description: Image credit that shows above the image
        imageAlt:
          $type: textField
          label: Image Alt Text
          description: Image Alt text that shows up below the image

      layout:
        $type: tabbedLayout
        tabs:
          asset:
            label: Asset
            fields:
              - name: imageCredit
              - name: imageAlt
              - name: caption
  1. I am unable to show these in the default main tab of assets in admin central
  2. I am unable to show the data stored in JCR

Image in the link

I have tried the following codes but failed:

[#assign asset = damfn.getAsset(content.image)!]
[#assign imageMap = damfn.getAssetMap(asset)!]

${imageMap.metadata.mgnl.imageCredit!}
0

There are 0 answers