ayon-core icon indicating copy to clipboard operation
ayon-core copied to clipboard

Chore: Add 'parents' to folder template data

Open iLLiCiTiT opened this issue 7 months ago • 7 comments

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:

  1. You can use e.g. {folder[parents[0]]} in templates.
  2. Test it with an optional template key <{folder[parents[0]}> works from a ROOT folder (does not have any parent folders).

iLLiCiTiT avatar Jul 15 '24 13:07 iLLiCiTiT