I am trying to add templates for the paragraph in the custom module. It invokes only the paragraph.html.twig.
In theme suggestion, paragraph–example-ch-hero-panel.html.twig is given. I am using the same templates. By default, The template will be taken for the paragraph here. But here its not working. I am not using hook_theme in .module for this. because I am not passing any values to the templates.
even try this also
function example_ch_hero_panel_theme() { return [ 'paragraph__example_ch_hero_panel' => [ 'render element' => 'element', 'template' => 'paragraph--example-ch-hero-panel', 'base hook' => 'paragraph', ], ]; }
added theme registry too
function example_ch_hero_panel_theme_registry_alter(&$theme_registry) { $theme_registry['page']['path'] = drupal_get_path('module', 'example_ch_hero_panel') . '/templates'; }
Please try again later.TwigErrorLoaderError: Template "modules/custom/example_ch_hero_panel/templates/page.html.twig" is not defined. in TwigLoaderChainLoader->getCacheKey()
can anyone sort out this issue.