Jump to content

Recommended Posts

Posted

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?

Posted
/**
 * 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.

Posted

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.

Posted

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.

Posted

Yeah, even with the config module, there's still separation. That said, it's not a heavy separation - i.e. between back-end and code. Would be cool if there was a proper way to manage these links/attachments in terms of a global scope.

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
  • Recently Browsing   0 members

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