Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modular template extension follows the master page extension #2044

Merged
merged 1 commit into from
Jun 8, 2018

Conversation

jbanety
Copy link
Contributor

@jbanety jbanety commented May 31, 2018

This PR is related to the issue #1818.
This builds the modular template extension from the URI's extension (i.e. http://examp.le/my-page.amp or http://examp.le/other-page.docx).
It fallbacks to TEMPLATE_EXT const if URI extension is null or empty.


For my project :

I'm creating an AMP version of my website in the same theme.

my custom system.yaml

...
pages:
  ...
  types:
    - html
    - amp
  ...

So I have two template extensions : .html.twig for the regular pages and .amp.twig for the AMP pages.

I'm using the same content for the two versions.

If I create a modular page with the .amp.twig, Twig will load modular templates with the extension .html.twig (which will be wrong formated for AMP framework and not validated).

@rhukster
Copy link
Member

rhukster commented Jun 8, 2018

Should this be limited only to modular pages? Does this make sense for modular and non-modular both??

@jbanety
Copy link
Contributor Author

jbanety commented Jun 8, 2018

Modular template name is hard-coded with the constant.
So yes it's a quick fix for modular only.

@rhukster
Copy link
Member

rhukster commented Jun 8, 2018

Ah yes, I see now.. Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants