Skip to content

erik-seifert/twig_extender

Repository files navigation

CONTENTS OF THIS FILE

  • Introduction
  • Requirements
  • Installation
  • Configuration
  • Maintainers

INTRODUCTION

The Twig Extender module adds a simple plugin system to add new twig extensions (Filter and Functions). Provides a new service provider for "twig.extensions" to add new plugins.

REQUIREMENTS

This module requires no modules outside of Drupal core.

  • Drupal 8.2 or lower: Use Twig Extender 8.1.
  • Drupal 8.3 or higher: Use Twig Extender 8.2.

INSTALLATION

CONFIGURATION

Function: Create Block Using for creating a block configuration on the fly

{{ block_create('plugin_id', [<plugin-config>]) }}

Function: View Block Using a existing block configuration

{{ block_view('config_entity_id') }}

Function: Is user logged in

{% if user_is_logged_in() %}
  Hello user
{% else %}
  Please login
{% endif %}

Function: Is front

{% if is_front() %}
On frontpage
{% endif %}

Filter: To url

{{ node|to_url }}
{{ urlObject|to_url }}

For more information visit: https://github.com/b-connect/twig_extender

MAINTAINERS

Supporting organization:

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published