Global Template Update
Author: Martin Robinson
1. Introduction
This guide will quickly walk you through installing and configuring a custom mass-template change script. It assumes that you have a recent version of PHP installed on your web server and that you are comfortable with Cascade. Knowledge of PHP is also useful, but not necessary to use this guide.
2. Components
There are several components to the template change system including the script itself and the configuration page. The script will read its configuration from a configuration file that you will publish (with the use of a data definition), and update all specified pages, giving them the new template.
3. The Configuration Page
Create a page called "templates.xml" and give it a .php publish extension. Then give it the template-change-config-data-definition.xml data definition. Supply a valid user-name, password, and server URL. After this is done, put the contents of the new template into the XHTML Block, or fill in the target field with the path to the template that you want to be used. If both are filled in, the target will be used. Next, add the path to all templates that you want to be changed.
4. Using
To use the script, publish the page and file assets. Enter in proper server authentication information in the configuration page,
and make sure that all templates you want modified are listed. Then supply the desired XHTML Block, and publish the page.
Running the script will then update all listed templates.Global Template Update Files
- global-template-php.txt
This is the main script that updates a global template via web services. - global-template-data-definition.xml
This is the data definition used to populate the XML config file. - global-template-xml-php.txt
This is an example XML config that will import a template into Cascade and overwrite the designated templates that already exist. - global-template.zip
This is a zip file that contains all the necessary scripts and config files.