Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Different metadata for different asset category

Avatar

Level 4

Hi,

We have a requirement that depending on the category of the asset , a list of metadata needs to be applied to that asset ( eg, marketing asset have a different set of metadata than product asset )

Is it possible to achieve the same with AEM asset metadata schema or somehow else?

1 Accepted Solution

Avatar

Correct answer by
Level 10

One way is define all the fields & then control with acl.

Alternative for classic ui is using a listener on the particular field you want to hide and then hide the field based on the path. To do this, create a listeners node of type nt:unstructured under the field  (e.g. /apps/dam/content/asseteditors/image/jpeg/formitems/person/listeners) and set the beforeloadcontent property something like:
function(f, r, p) { if (p.indexOf("/content/dam/geometrixx/") == 0) { f.hide(); } return true; }
This will hide this field for assets under /content/dam/geometrixx. You could adjust this to meet other requirements.

Tryout Apply same principal to touch ui but never tried personally.

View solution in original post

4 Replies

Avatar

Level 4

Hi Scott,

Looking for a little different thing.Need to define 2 kinds of asset ( lets say both having MIME type jpeg), but having different metadata schema.

Is it possible?

Avatar

Correct answer by
Level 10

One way is define all the fields & then control with acl.

Alternative for classic ui is using a listener on the particular field you want to hide and then hide the field based on the path. To do this, create a listeners node of type nt:unstructured under the field  (e.g. /apps/dam/content/asseteditors/image/jpeg/formitems/person/listeners) and set the beforeloadcontent property something like:
function(f, r, p) { if (p.indexOf("/content/dam/geometrixx/") == 0) { f.hide(); } return true; }
This will hide this field for assets under /content/dam/geometrixx. You could adjust this to meet other requirements.

Tryout Apply same principal to touch ui but never tried personally.

Avatar

Level 4

Thanks Sham,

Will try that approach.