Implementing hooks for custom content entities

In order to make your custom content entity work with DX8 you will need to alter the suggestions using hook_theme_suggestions_HOOK_alter. DX8 provides a method you can implement inside the hook that will alter the suggestions according to your DX8 setup

The first argument is the array of suggestions, the second argument is the entity you are altering the suggestions for, ( usually in $variables['elements'][entity_type] ), the third argument is the view mode used to render the entity, and the last argument the entity type

For example, if you want to enable paragraphs you need to implement the hook hook_theme_suggestions_HOOK_alter using the cohesion_templates_suggestions method as follows:

Most of the time the base theme hook is the same as the entity type name, therefore DX8 takes the entity_type to generate its twig file (ex: for a node template the generated twig will have a name of node__template-name). However if the entity_type doesn’t match the base theme hook, you will have to implement a DX8 hook hook_cohesion_templates_ENTITY_TYPE_base_hook_alter in order to provide the right base hook name