This is the production ready, battle tested implementation of the Twig Theme system for Drupal 7. It's not a backport from the D8 version, but it can be useful in a upgrade path.

It comes as theme engine file and a small library with the bindings to Drupal, you need to install Twig separately in your libraries system. See http://tfd7.rocks/install on how to install and use the theme engine.

This project has been in development over a few years and runs a fair amount of websites in production. The code is autoformatted using PHPStorm, it was originally written as a PSR1 compliant version.

I do believe that having the twig engine in D7 can be a useful thing considering the upgrade path to D8 when it is released. Developing A D7 site with twig templates that are syntactically 95% compatible with D8 can ensure a smoother process when upgrading to D8 later.

And last but not least, the project can be found here https://www.drupal.org/sandbox/ReneB/1075966 but please do read the install first, this is not a module or theme, it is a theme engine!

Comments

rene bakx’s picture

Issue summary: View changes
rene bakx’s picture

Issue summary: View changes
SebCorbin’s picture

I think you need to

More info on http://pareview.sh/pareview/httpgitdrupalorgsandboxreneb1075966git

rene bakx’s picture

Thank you for the tips, the branche is actually 7.x-2.0-dev, because the 7.x-1 branch existed till a a year ago as straight port from the D6 version back then. I cleaned up most of the code and decided to go with a 7.2.x instead of a 7.1.x instead.

I will copy some of the content to the project page, but the main source of documentation will be tfd7.rocks.

rene bakx’s picture

PA robot’s picture

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

taslett’s picture

Component: theme » other
Status: Needs review » Reviewed & tested by the community

Hi Rene,
I have created a D7 twig theme following your instructions for setting up the engine, it works well.
The version I downloaded required changing the filename of Nodevisitor.php to NodeVisitor.php.
Most web servers (Linux) will be case sensitive.

Thanks @SebCorbin for the main bootstrap twig files. I have also converted the other bootstrap tpl files and will make them available to you via github.

rene bakx’s picture

Strange.. I thought i fixed that NodeVisitor issue once and for all by renaming it. Guess it only worked for the Github version.

cweagans’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for your contribution!

I updated your account so you can promote this to a full project and also create new projects as either a sandbox or a "full" project.

Here are some recommended readings to help with excellent maintainership:

You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!

Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

Thanks to the dedicated reviewer(s) as well.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

avpaderno’s picture

Component: other » other project types