Related asset metadata with dynamically set "restrict rootnodes"


(James Porich) #1

Matrix Version: v5.5

What we’re trying to do
We have a Content Container Template currently being used across several Sites. This container allows users to select “tags” by way of a Related Asset field. These tags are currently Link Assets which the user can create themselves under a particular folder under the site.

The idea is, that each site has a set of tags - each Site globe is able to point to it’s “sets” of tags to use by way of a Related Asset field (e.g. “this folder and that folder are this site’s tag sets”).

The CCT would then hopefully be able to use the metadata field set on the Site Globe as the restricted rootnodes for users to select tags from.

the problem
It appears that the Related Asset metadata fields don’t allow for keywords :frowning: Is there some way for a CCT to have it’s restricted rootnodes dynamically set elsewhere?

  • We have something used globally (the CCT)
  • It needs to be used in a restricted way
  • The restrictions should be able to be added to dynamically over time as we make new sites with different sets of tags
  • We want things to be self-managed over time (so link assets users can add themselves is preferable to something like Thesaurus)
  • We don’t want to make a single huge collection of tags to use as the CCTs restricted rootnode (as there’s potentially thousands with some growth)
  • We want to be able to localise certain CCT functions to the current site, and keep others global

Is there a neat way about going around this? Happy for a starting point to explore - or if there’s other solutions already out there I’d be happy to know more!


(John gill) #2

The root nodes can’t be dynamic at all, since they are stored as NOTICE links.

I suspect the “least hassle” way of achieving this would be to create a new CCT for each site that will use it. They could all re-use the same Paint Layout and Simple Edit Layout (and if you’ve got Metadata fields other than the related asset field, they could share a Metadata Section as well). The overhead for each new site would just be:

  • Content Template asset
  • Metadata Schema asset
  • Metadata Section asset
  • Metadata Field asset

Unless you’re going to have more than “dozens” of sites, I doubt it’s worth scripting up fancy API shenanigans to work around it.


(James Porich) #3

Hmmmmm unfortunately not ideal as this would be something used with more than a few dozen websites.

At this point it shouldn’t pose too much of an issue as the users should be restricted to their write access level anyway, but it would be nice to be able to dynamically set a restricted rootnode just as you can dynamically set rootnodes with other asset types :frowning: