Jump to content

Auto Append/Prepend to Template


Mike Rockett
 Share

Recommended Posts

If this can already be done, then shoot me. ;)

I often find myself specifying the header/footer (prepend/append) for each template on every site I make. I think this could be automated, if asked to be by the developer/designer.

This could be done by means of a check box for each. "Prepend this file to all templates" and "Append this file..."

Feasible?

Link to comment
Share on other sites

/**
 * Prepend template file 
 * 
 * PHP file in /site/templates/ that will be loaded before each page's template file.
 *
 * #notes Example: _init.php
 * @var string
 *
 */
$config->prependTemplateFile = '';

/**
 * Append template file 
 * 
 * PHP file in /site/templates/ that will be loaded after each page's template file.
 * 
 * #notes Example: _main.php
 * @var string
 *
 */
$config->appendTemplateFile = '';

Additionally there are settings about changing / preventing these configs in the template edit section.

Link to comment
Share on other sites

The just isn't a global configuration gui in ProcessWire right now. (Read below) But it shouldn't be hard to just pack all those $config variables in a module with some forms. I think to remember that Ryan some time ago said it's this way so /site/config.php doesn't have to be writeable or something like that.

Link to comment
Share on other sites

It's not really in the dev branch. It's still an extra module to install by now even though it looks like it would be in the core if one just reads over the first lines. That's what confused me about it, because I thought I would have noticed it sometimes as a core module.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...