Skip to content

Commit

Permalink
v0.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
rolandtoth committed Feb 19, 2019
1 parent 38bce74 commit cbac28b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
# Changelog


### 0.6.1 (2019-02-19)

- ignore templates by exact match (suggested by Sergio)
- ignore `*.tpl.php` templates by default



### 0.6.0 (2019-02-09)

- Allow customization of breadcrumb display field (PR #4 by @philippdaun)



### 0.5.9 (2018-04-24)

- added "replacevalues" filter
Expand Down
16 changes: 9 additions & 7 deletions TemplateLatteReplace.module
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class TemplateLatteReplace extends WireData implements Module, ConfigurableModul
'summary' => __('Latte template engine support for ProcessWire.', __FILE__),
'href' => '',
'author' => 'Roland Toth',
'version' => 60,
'version' => '0.6.1',
'requires' => 'PHP>=7.0.0, ProcessWire>=3.0.0',
'autoload' => true,
'singular' => true,
Expand Down Expand Up @@ -172,17 +172,19 @@ class TemplateLatteReplace extends WireData implements Module, ConfigurableModul
$markup = '';
$templateFile = $event->object;

if (strpos($templateFile->filename, '.tpl.php')) {
return;
}

if ($templateFile->page->template->name === 'admin') {
return;
}

if ('' !== $this->ignoredTemplates) {
$ignoredTemplates = explode(',', $this->ignoredTemplates);

foreach ($ignoredTemplates as $t) {
if (strpos($templateFile->filename, trim($t)) !== false) {
return;
}
$ignoredTemplates = array_map('trim', explode(',', $this->ignoredTemplates));

if (in_array($templateFile->page->template->name, $ignoredTemplates)) {
return;
}
}

Expand Down

0 comments on commit cbac28b

Please sign in to comment.