I'd like to move to Drupal 8 for my next project. I understand that, from version 8, Drupal standard template engine is Twig.

Is it possible to build a brand new Drupal 8 theme without using Twig at all?

  • 2
    Can you expand a little on why you don't want to use Twig and what template engine you would like to use? – mpdonadio Dec 7 '18 at 13:48
  • 1
    You can add HTML markup to templates without touching any Twig code. At some point, though, you might want to use Twig, but this depends on what you want to do. You have to be more specific. – 4k4 Dec 7 '18 at 13:49
  • 4
    If you don't want to use Twig, you also shouldn't use Drupal theming, but go the headless way. Fetch data with JSON API and use whatever you want for theming. (And double your planned time budget for the project.) – Hudri Dec 7 '18 at 14:06
  • Several reasons to avoid the single-option template engine may exist. The concept is wide, while I read the question as very concise and clear. Can't see the point of downvoting. – augusto Dec 7 '18 at 14:30
  • Remember that Twig automatically escapes dangerous html, so if you use something else don't forget about security. – No Sssweat Dec 8 '18 at 17:27

Consider using React, Angular, Vue, or Gatsby as an application development framework with Node.js & use GraphQL for the Drupal 8 integration with other APIs, i.e. a decoupled or headless Drupal CMS solution. You may still need to use a Twig theme for the D8 administration section, although there are also projects in development for that.

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