wearewondrous/fractal_compound_handles

convert html nunjucks template in html twig template (drupal 8)

Opened this issue · 3 comments

Hi,
how can I use your code in order to convert html nunjucks template in html twig template, for drupal 8?

I've installed your module in drupal, but I don't know what to do now.

I'm sorry if I'm asking trivial questions.

Hi marcyborg,

I don't know if I understand you corrcetly. Nunjucks and twig are 90% identically written. so just rename the file to .twig and there you go.

This module does no conversion. It is supposed to be used together with a component library like Fractal living in a different folder than the theme/templates.

Thanks for your reply.

I try to explain better my use case: I've a project based on html nunjucks, with a series of .tmpl files, which uses Fractal also as a library.
I want to convert this project in html twig, because I'm going to develop a template on Drupal 8, basing on Bootstrap template.

All right when you say that this module does not any type of conversion, and nunjucks and twig are 90% similar.

Is your module suitable for my purpose?

Hi again,

so in general you are correct using this drupal module. But in addition to use Fractal within an other folder than the drupal templates folder you may also need our other module

https://github.com/WondrousLLC/twig-drupal

to make Fractal aware of the correct paths. Then you are good to go :)