Catalogs

Lists of values that admins maintain (project types, tags): searchable choices in forms, titles in views, filters – and a page to maintain them.

The code

app/_config/catalogs.yml – Declaring the catalogs whole file
Atwx\SilverstripeFrontdeskKit\Catalog\Catalogs:
catalogs:
project_type: { title: 'Project types' }
tags: { title: 'Tags' }
app/src/Models/Project.php – Catalog fields of a model whole file
private static array $many_many = [
'Tags' => CatalogEntry::class,
];

private static array $cascade_deletes = ['Tasks', 'Notes'];

/**
* Catalog fields: relation => catalog key (app/_config/catalogs.yml).
*/
private static array $catalog_fields = [
'Type' => 'project_type',
'Tags' => 'tags',
];