Using include files as from Perl template toolkit

I would like to use Pinegrow Pro to edit HTML files for a site that is compiled with Perl Template Toolkit. Each page on the site looks like:

[% include head.inc %]

(HTML content of the page)

[% include foot.inc %]

The template toolkit postprocesor includes head.inc and foot.inc in each page. (This is how many sites were made before CMS were developed)

I don’t want Pinegrow to take over combining the elements of the page together (as it sounds like the Projects feature would do), I want template toolkit to keep doing that as this is an existing site that makes use of the toolkits other features.

I have briefly looked at components, blocks, projects, etc. but I am hoping someone could offer advice on a good way to do this without me having to spend hours experimenting.

Any ideas?

P. S. I tried loading one of the .inc files in Pinegrow. I had to restart it, it did not like that file at all. I could combine the head.inc and foot.inc into one files, which would then be a valid HTML file without the main content of a page.

I have experimented with a few things, and this approach seems to work:

Make an additional page, we’ll call it PGtemplate.tt2:

[% include head.inc %]

<div id="insert"></div>

[% include foot.inc %]

Run that page thought the template postprocessor to generate the complete HTML file, PGtemplate.html, which contains all of the header and footer files, but only this #insert DIV as the “body” of the page.

Open a Project in Pinegrow in the directory where your source files are. Right click on the file you want to edit and select Open as Partial, then put “PGtemplate.html” and “#insert” in the fields in the dialog box. This is explained further in http://docs.pinegrow.com/pinegrow-pro/partials/working-with-partials.

You will still see text like " [% include head.inc %]" somewhere in the page display, but you can edit the pages with the full styling you would get from the template.

Does anyone have any better ideas or suggestions?

1 Like

Today I tried using this technique in my new Pinegrow 4. It says “partials are not implemented, revert to 2.9” or something like that. This is very disappointing.

Surely some of your other users are using server-side includes, etc?