diff --git a/wire/modules/PageRender.module b/wire/modules/PageRender.module index a9233c26..7c482998 100644 --- a/wire/modules/PageRender.module +++ b/wire/modules/PageRender.module @@ -517,9 +517,12 @@ class PageRender extends WireData implements Module, ConfigurableModule { throw new WireException('Missing or non-readable template file: ' . basename($options['filename'])); } } - + if($this->wire('config')->useMarkupRegions) { - $this->populateMarkupRegions($data); + $contentType = $template->contentType; + if(empty($contentType) || stripos($contentType, 'html') !== false) { + $this->populateMarkupRegions($data); + } } if($data && $cacheAllowed && $cacheFile) $cacheFile->save($data); @@ -541,7 +544,7 @@ class PageRender extends WireData implements Module, ConfigurableModule { */ protected function populateMarkupRegions(&$html) { - $pos = stripos($html, '