Matrix Version: 5.4
Can someone help me with a keyword (if it exists) to find if a Matrix asset (PDF) has a metadata schema applied to it.
Doing an audit on PDF’s using an Asset Listing
Cheers
N
Matrix Version: 5.4
Can someone help me with a keyword (if it exists) to find if a Matrix asset (PDF) has a metadata schema applied to it.
Doing an audit on PDF’s using an Asset Listing
Cheers
N
I’m fairly confident there is no such keyword.
I believe that the Asset->Schema association isn’t even loaded when an asset is processed for the frontend. The metadata is picked up from an on-disk copy which only contains field info.
(Obviously the dirty solution would be to add a field with a default value to the schema, then regenerate the metadata for all assets with that schema, then check for the default value in your listing. Ew)
If you use the %asset_data_metadata% keyword it should give you the asset IDs of the metadata fields applied to the asset, from that you should be able to tell what Schema is applied.
And I expect you could then use the ^eq modifier (or similar) to display whether or not a specific Schema (by asset ID) is applied as a true/false response.
Using Bart’s neat trick (), youcouldn’t check for a schema but you could check for a field even if that field has no value set. So if you have a field called select with the assetid 18058, you’d use
%begin_asset_data_metadata^index:select^index:fieldid^eq:18058%
I just tested it with on:
and it behaves as expected, true for the first two and false for the third.