ayon-core
ayon-core copied to clipboard
Chore: Add 'parents' to folder template data
Changelog Description
Add "parents"
subkey to folder template data.
Additional info
This does allow to use indexing of parent names in templates. I'm not sure if this is correct approach, but it is the best I could think of. This change does not consider that someone would like to use e.g. labels instead of names in future, hopefully that won't happen.
There is no safeguard for using the list, so if the parent index is not available it will just crash. That might cause issues in specific logic which is filling template paths and does not count on this.
Testing notes:
- You can use e.g.
{folder[parents[0]]}
in templates. - Test it with an optional template key <{folder[parents[0]}> works from a ROOT folder (does not have any parent folders).