Modify Loader Code to Load Group Entities

Hello,

I’ve created a custom Group Entity that contains a field, sg_published_files, which is a list of linked Published Files. I’d like to modify the loader code to look for my custom group entity as well as for published files, but I’m having a hard time identifying where within the code I’d be able to adjust what the Loader queries for. Is there already an existing implementation of this somewhere I could reference?

Are you modifying the app itself?

You are better of using a hook and the yaml files to configure an extra tab that shows your desired files.
Usually you dont have to modify the app code itself.

The hope was to be able to modify the app itself, but it might be too much of a hassle

Why would you want to modify the app instead of using the hooks (which are designed for most customisation).

Hi Sophia,

It should be easy enough for you to modify the loader via a config file, in the default “advanced” config it would be this file here:
{config}/env/includes/settings/tk-multi-loader2.yml

The way the tabs are structured is very flexible depending on how you configure them. The key for you might be to add or modify the entities section to include a new Tab for Groups, or to place the group field in the hierarchy of another tab.

Here is an example of something I just configured while working on our Photoshop Integration:

By comparing this and the different things in the config file, you might be able to figure out how to achieve what you’re asking about.

settings.tk-multi-loader2.photoshop.asset:
  action_mappings:
    Rendered Image: [ add_as_a_layer ]
    Image: [ add_as_a_layer ]
    Texture: [ add_as_a_layer ]
  entities:
  - caption: Current Asset
    entity_type: Version
    filters:
    - [ project, is, '{context.project}' ]
    - [ entity, is, '{context.entity}' ]
    - [ sg_status_list, is, apr ]
    - [ published_files, is_not, null ]
    hierarchy: [ sg_task, code ]
  - caption: Parent Asset
    entity_type: Version
    filters:
      - [ project, is, '{context.project}' ]
      - [ entity.Asset.assets, is, '{context.entity}' ]
      - [ sg_status_list, is, apr ]
      - [ published_files, is_not, null ]
    hierarchy: [ sg_task.Task.step ]
  - caption: All Assets
    entity_type: Version
    filters:
    - [ project, is, '{context.project}' ]
    - [ entity, type_is, Asset ]
    - [ entity.Asset.sg_status_list, is_not, omt ]
    - [ sg_status_list, is, apr ]
    - [ published_files, is_not, null ]
    hierarchy: [ entity.Asset.sg_asset_type, entity, sg_task.Task.step ]

1 Like