I just realised that “cascading” a metadata value is a one time thing and doesn’t make new assets inherit the cascaded value. Which gives me a challenge and I’m hoping someone can suggest the best approach…
I have 30+ folders on my site that represent “branches” of my organisation. Within each is a hierarchy of stuff relevant to that branch, including news and event assets. I’m building pages that will aggregate latest news and events from across the country. Simple asset list that pulls from the overall root folder. In the entry for each item, I need to show which branch its associated with, and other details from that asset.
So I created a metadata schema with an entry for “Branch” and set that on each branch root folder (pointing to itself, with the cascade set). Thus in the asset listing I have lots of %asset_metadata_Branch^as_asset:….% Works fine… until someone adds a new asset and the metadata field is blank because cascade isn’t dynamic. Because of the way these areas are maintained its not acceptable to expect the authors to remember to go set the field manually each time. Here are some of the ideas I had, would love to know what people think is best, and any better ideas:
- Create a separate trigger for every branch, and have it set the metadata value for any new item. How big an overhead is having 30+ separate triggers on every Asset Create event?
- Create a separate metadata asset for each branch with identically named fields, but with the default value (which does cascade automatically) set for the branch it will be applied to. Not sure how the system works if multiple metadata schema all have a field called “Branch”?
- Write some sort of background script that could run regularly under “cron” and effectively do the cascade. I’m sure its easy for someone who knows how the Squiz low level stuff works but I would be starting from scratch so it’s a big challenge. Could possibly pay Squiz to do it.
I just wish there was some sort of %parent…% keyword. I realise there’s a conceptual problem that an asset can be linked to multiple places in the tree and have multiple parent, but in my case I know that wont happen so its frustrating not to have something. Maybe a %parent_assets% that returns a comma sep list of all parent asset ID’s and those of us who can guarantee it will only ever have one entry can go ahead and safely use it with ^as_asset etc !
All helpful suggestions gratefully received!