Skip to content

Commit

Permalink
Use append_url_extension from page header to set template format #2604
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed Nov 10, 2018
1 parent 82d3d5e commit 9b43f20
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* Allow request headers `Content-Type` to set the template type [form#221](https://github.com/getgrav/grav-plugin-form/issues/221)
1. [](#bugfix)
* Fixed `Uri::hasStandardPort()` to support reverse proxy configurations [#1786](https://github.com/getgrav/grav/issues/1786)
* Use `append_url_extension` from page header to set template format if set [#2604](https://github.com/getgrav/grav/pull/2064)

# v1.6.0-beta.5
## 11/05/2018
Expand Down
4 changes: 4 additions & 0 deletions system/src/Grav/Common/Page/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -1287,6 +1287,10 @@ public function templateFormat($var = null)
$this->template_format = $var;
}

if (empty($this->template_format)) {
$this->template_format = $this->url_extension;
}

if (empty($this->template_format)) {
$content_type = Grav::instance()['uri']->getContentType(true);
$fallback_type = Utils::getExtensionByMime($content_type);
Expand Down

0 comments on commit 9b43f20

Please sign in to comment.