Skip to content
This repository has been archived by the owner on Apr 24, 2019. It is now read-only.

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

Open
marcyborg opened this issue May 23, 2017 · 3 comments
Open

Comments

@marcyborg
Copy link

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.

@tassilogroeper
Copy link

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.

@marcyborg
Copy link
Author

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?

@tassilogroeper
Copy link

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 :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants