Download the PHP package heimrichhannot/contao-twig-templates-bundle without Composer

On this page you can find all versions of the php package heimrichhannot/contao-twig-templates-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package contao-twig-templates-bundle

Contao Twig Templates Bundle

Latest Stable Version Total Downloads

This bundle builds on top of Twig support bundle and replaces the most core templates with twig templates. In addition, it comes with an expandable frontend framework architecture that allows to select a frontend framework in your layout and automatically use customized templates instead of the core templates.

Features

Installation

Install via composer: composer require heimrichhannot/contao-twig-templates-bundle and update your database.

Additional frontend frameworks

Available (known) extensions:

Usage

It's as simple as that: Check 'Use twig templates' in your page layout configuration. If your want to use a frontend framework like bootstrap, select the corresponding option in the 'Use framework' select. This way the automapping takes place and according to the current content element or module, the correct template is used.

Automapping order (check if template exists, else use the next one):

  1. Frontend framework twig template
  2. Core/custom twig template
  3. Default/Custom (contao html5) template

If you don't want to use automapping you can also assign the template you want in the ordinary way by selecting it in the customTpl field of your module or content element.

Additional dca configuration keys

These keys can be used in fields eval entry:

Key Description
inputPrepend Content to be added before the input (within input-group-prepend). Overrides other prepended elements.
inputAppend Content to be added after the input (within input-group-append). Overrides other appended elements.
inline Input will be displayed horizontal. Only for checkboxes and radio buttons.
groupClass Classes for outer form group wrapper (default: form-group)
inputGroupClass Classes for input group wrapper (input-group is always added)

Additional twig functions

Function Description
getCurrentLanguage Return the current language ($GLOBALS['TL_LANGUAGE'])

Bundled templates

Block templates

Template Bundled
block_searchable core
block_unsearchable core

Content elements

Content Element bundled core bundled bs4
Accordion Single x x
Accordion Start x x
Accordion Stop x x
Code x x
Download x x
Downloads x x
Gallery x x
Headline x x
HTML x
Hyperlink x
Image x
List x
Markdown x
Player x
Slider Start x
Slider Stop x
Table x
Teaser x
Text x
Toplink x
Vimeo x x
Youtube x x

Member elements

Content Element bundled core bundled bs4
Member default x
Member grouped x

Gallery

Content Element bundled core bundled bs4
Gallery default x x

Both version with minimal setting. You definitely need to change those templates to fit your requirements.

Modules

Modules bundled core bundled bs4 changes
Article x removed Gplus Button
Article List x
Article Nav x
Book Nav x
Breadcrumb x x
Change Password x
Close Account x
Custom Nav x
HTML x
Login x x
Lost Password x
Message x
Navigation x
Password x
Quicklink x
Quicknav x
Random Image x
Search x x
Sitemap x

Navigation

Modules bundled core bundled bs4
Nav Default x
Nav Inline x
Nav Tabs x
Nav Vertical x

Search

Modules bundled core bundled bs4
Search Default x x
Search List Group x

Developers

Events

To modify template data before parsing or rendering, use the events of twig support bundle with a priority lower than 100 (0 is default, so you don't need to set this value in most cases).

Add custom frontend frameworks

  1. Create a class which implements HeimrichHannot\TwigTemplatesBundle\FrontendFramework\FrontendFrameworkInterfacce

    Please read the method comments for implementation

  2. Register your newly created class as service with huh.contao_twig_templates.framework service tag
  3. For each template, you want to replace, create an html5 template (where filename suffix is the same as the identifier set in the class, example form_checkbox_bs4.html5) and call the template factory. Typical this code can be used without any adjustment:

    • If your want to set template specific options (for example bootstrap 4 custom control support) you can use $template::addSupport(). Example:
  4. Create a twig template with the same name as the html5 template (e.g. form_checkbox_bs4.html.twig). This is the place where your custom template code will live. All template variable are given as twig variables. Please see bundle templates for some examples.

Template variables

Additional template variables

Name Type Default Description
groupClass string form-group The outer form group class
inputGroupClass string form-group The input group class
_entity object - The context entity object (e.g. \Contao\FormTextField)

All versions of contao-twig-templates-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ^8.0
contao/core-bundle Version ^4.9
heimrichhannot/contao-twig-support-bundle Version ^0.2.1||^1.0
heimrichhannot/contao-utils-bundle Version ^2.222
symfony/event-dispatcher Version ^4.4||^5.4
symfony/event-dispatcher-contracts Version ^1||^2||^3
symfony/translation Version ^4.4||^5.4
symfony/translation-contracts Version ^1.1.6||^2||^3
symfony/polyfill-php80 Version ^1.26
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package heimrichhannot/contao-twig-templates-bundle contains the following files

Loading the files please wait ....