This project is not covered by Drupal’s security advisory policy.

This module is helper for rendering Handlebars.js templates in Twig.

Requirements

xamin/handlebars.php library

composer require "xamin/handlebars.php"

Installation

It is required to install xamin/handlebars.php first, as described in requirements.

Handlebars.js module can be installed in two ways:

  • Download and enable module in standard way
  • Download module with composer and enable in standard way:
    composer require "drupal/handlebarsjs"

If composer is used, requirements will be downloaded automatically.

Usage

We have template block-foo.hbs with content:

<div data-component="block-foo">
    <h2>{{title}}</h2>
    {{{description}}}
</div>

We define new theme with name block_foo:

function mymodule_theme() {
    return [
         'book_foo' => [
            'variables' => [
                'title' => NULL,
                'description' => NULL
            ],
         ],
    ];
}
Supporting organizations: 

Project information

  • caution Seeking new maintainer
    The current maintainers are looking for new people to take ownership.
  • Created by euphoric_mv on , updated
  • shield alertThis project is not covered by the security advisory policy.
    Use at your own risk! It may have publicly disclosed vulnerabilities.

Releases