Skip to content

Commit

Permalink
Allow to disable system templates from being rendered by the active t…
Browse files Browse the repository at this point in the history
…emplate engine
  • Loading branch information
wanze committed Sep 28, 2019
1 parent 4ff4085 commit 812879f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 13 deletions.
11 changes: 9 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## [Unreleased]

## [2.0.1] - 2019-09-28

### Fixed

* Allow to disable system templates from being rendered by the active template engine, see [TemplateEngineTwig issue #21](https://github.com/wanze/TemplateEngineTwig/issues/21).

## [2.0.0] - 2019-02-13

* First release of the new major `2.x` version 🐣
Expand Down Expand Up @@ -29,7 +35,7 @@ and debug mode is enabled.

### Fixed
* Add a hook before `ProcessPageView::pageNotFound` to handle `Wire404Exception` thrown by controllers.
The current active template engine now receives the configured page displaying a 404 rather
The current active template engine now receives the configured page displaying a 404 rather.
than the page throwing the 404 exception.

## [1.1.1] - 2018-03-18
Expand All @@ -41,8 +47,9 @@ than the page throwing the 404 exception.
* Lower hook priority for the hook executed after `Page::render`. This makes sure that the current active
template engine returns the markup *before* other modules hooking after `Page::render`.

[2.0.1]: https://github.com/wanze/TemplateEngineFactory/releases/tag/v2.0.1
[2.0.0]: https://github.com/wanze/TemplateEngineFactory/releases/tag/v2.0.0
[1.1.3]: https://github.com/wanze/TemplateEngineFactory/releases/tag/v1.1.3
[1.1.2]: https://github.com/wanze/TemplateEngineFactory/releases/tag/v1.1.2
[1.1.1]: https://github.com/wanze/TemplateEngineFactory/releases/tag/v1.1.1
[Unreleased]: https://github.com/wanze/TemplateEngineFactory/compare/v2.0.0...HEAD
[Unreleased]: https://github.com/wanze/TemplateEngineFactory/compare/v2.0.1...HEAD
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ execute the following command:
composer require wanze/template-engine-twig:^2.0
```

This will install the _TemplateEngineTwig_ and _TemplateEngineFactory_ modules in one step, no need to install both
separately. It also installs the Twig dependencies for us, pretty neat! ✌️
This will install the _TemplateEngineTwig_ module and all Twig dependencies.

> ℹ️ This module includes test dependencies. If you are installing it on production with `composer install`, make sure to
pass the `--no-dev` flag to omit autoloading any unnecessary test dependencies!.
Expand All @@ -67,7 +66,7 @@ either enable or disable templates.
> More configuration options might be available in the module providing a template engine, e.g. the
module _TemplateEngineTwig_ offers several configuration related to Twig.

## Available Template Engines
## Available template engines

* **ProcessWire** A template engine using ProcessWire's *TemplateFile* class for rendering. This engine is bundled with
this module, but it is not installed automatically. Install the module _TemplateEngineProcessWire_ and select the
Expand All @@ -79,10 +78,10 @@ engine in the _TemplateEngineFactory_ module configuration.

## Getting Started

> This section assumes that Twig is used as active template engine, but the usage is excatly the same for any other
template engine.
> This section assumes that Twig is used as active template engine, but the usage is exactly the same for any other
chosen template engine.

### Using the Template Engine to render templates
### Using the template engine to render templates

Assume the following Twig template exists in `/site/templates/views/foo.html.twig`

Expand Down
8 changes: 4 additions & 4 deletions TemplateEngineFactory.module.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public static function getModuleInfo()
{
return [
'title' => 'Template Engine Factory',
'version' => 200,
'version' => 201,
'author' => 'Stefan Wanzenried',
'summary' => 'Provides ProcessWire integration for various template engines such as Twig.',
'href' => 'https://processwire.com/talk/topic/6833-module-templateenginefactory/',
Expand Down Expand Up @@ -325,11 +325,11 @@ public static function getModuleConfigInputfields(array $data)

$templates = [];
foreach (wire('templates') as $template) {
//Exclude system templates
$label = $template->name;
if ($template->flags & Template::flagSystem) {
continue;
$label .= ' (system)';
}
$templates[$template->id] = $template->name;
$templates[$template->id] = $label;
}

/** @var \ProcessWire\InputfieldSelect $field */
Expand Down
2 changes: 1 addition & 1 deletion TemplateEngineProcesswire.module.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public static function getModuleInfo()
{
return [
'title' => 'Template Engine ProcessWire',
'version' => 200,
'version' => 201,
'author' => 'Stefan Wanzenried',
'summary' => 'ProcessWire templates for the TemplateEngineFactory.',
'singular' => true,
Expand Down

0 comments on commit 812879f

Please sign in to comment.