Thread tagged as: Question

.html template extensions


I was wondering if it is possible to use another file extension when using <perch:template path="" as well as or in addition to .html

Garth Holmes

Garth Holmes 0 points

  • 4 years ago

Sorry, no.

The coding for perch and perch runway extracts the last 5 characters and checks if it's .html...

If yes, then it gets passed as submitted, otherwise it appends .html to the submitted value.

Therefore, it is not possible to change the template extension as this in set in code.

Robert Ketter

Hi Rob,

Thank you for writing.

So I guess this is a feature request then.

I will say though Perch is getting better all the time and I am happy with v3 changes but something like this would help with organisation of files, particularly when using multiple .html templates (notwithstanding the HTML5 <template></template> element).

Rachel Andrew

Rachel Andrew 394 points
Perch Support

Perch templates have a .html extension. If you want to write PHP do so in a page and pass that in as a template variable.