PHP templates

File structure

The template set has a number of files, including some optional files for specific tasks:

  1. page: used by all webpages on your site
  2. menu: creates your left-hand website menu/s
  3. settings_site: for information that applies across your site like responsible officer, short name etc.
  4. config: code used to display settings throughout your website
  5. Optional:
    1. Features - settings_features and features used for displaying the feature bar on your homepage
    2. RSS reader - rss_example, rss_functions, and rss_lib used for displaying content from ANU RSS feeds on your site

The templates work together with your Site ID to retrieve and include standard elements from the central store, such as the explore bar, banner, metadata, styles and footer.

Download

After joining the Web Publishers Group and registering your site, you will have access to the PHP templates:

Last updated: 19 Aug 2015

» read release history

Upgrade

Content management system (CMS) developers, please see the instructions for upgrading a CMS from version 3.

Newer templates have six files: config, pages, settings site, menu, features and settings_features

Configuration

Save the files on your webserver, in folder/s of your choice. Note that settings_site and config must be in the same folder and settings_features and features must be in the same folder.

  1. Edit settings_site.php
    1. Update anything in between *** markers with the values requested (and remove the ***)
    2. Change False to True if you would like a search box on your website menu
    3. Save your changes.
  2. Edit page.php.
    1. Update the reference for the config file to reflect the config file location (edit the code underneath the line //config file reference//)
    2. Save your changes.

Building webpages

Once you have installed following the steps above:

  1. Make a copy of page, rename it to index.php and save it in the root folder for your website. This will become your homepage.
  2. Edit index.php and view the source code. Update anything with *** markers.
  3. Save your changes and preview the webpage.
  4. Edit menu.php and ensure that the new webpage is on the site menu.
  5. Refer to the web style guide for styling options including adding features and RSS feeds.
You can repeat the above process to create more webpages. When naming files, be descriptive of the file contents and avoid using spaces in the filename. If you must have spacing, instead use a hyphen (-) or an underscore (_).

Dreamweaver can be used to view and edit the template files.

Use the split or code views so that you can see the parts of the code that you need to update:

use code or split view in Dreamweaver

Updated:  13 May 2013/ Responsible Officer:  Director Marketing/ Page Contact:  Webstyle