1

I installed a paragraph module and it uses twig from inside /modules/paragraphs/templates/ but I would like to override it inside my /theme/theme_name/ folder.

How can I do this? Thanks.

Edit:

<!-- FILE NAME SUGGESTIONS:
* paragraph--steps--default.html.twig
* paragraph--steps.html.twig
* paragraph--default.html.twig
x paragraph.html.twig
-->
<!-- BEGIN OUTPUT from 'modules/paragraphs/templates/paragraph.html.twig' -->

Twig debug looks for the file in modules/paragraphs/templates and I would need it to look in mytheme/templates/. :/

2 Answers 2

1

Simply copy the mentioned module template over to your theme's template folder. That's all.

1

Create templates folder inside your theme and enable Twig debugging, check here for how to enable twig debugging.

Once twig debugging enable look for theme suggestions and name the templates accordingly.

3
  • Please check edit in my main post.
    – Dragan
    Feb 22, 2018 at 13:33
  • Copy template file from paragraph module folder to the theme folder. Clear cache and reload page.
    – Sharique
    Feb 22, 2018 at 14:04
  • This answer is correct, to override a template you just need to copy the right suggestion name (that you want to use) into your theme in the /templates directory. Clear the cache, and Drupal will use that.
    – Kevin
    Feb 22, 2018 at 15:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.