Skip to content

Creating a new theme v3.1

Patrick Upson edited this page Jan 16, 2014 · 1 revision

Table of Contents

Creating a new theme

Before a new theme for the PHP Variant can be created the theme must exist in the core WET framework. Text for the them can be taken from the core framework demos and the Variant theme can be checked against the core theme.

Configuration File

  • In the /dist-php/config directory create a folder for the new theme (i.e /theme-gcwu-intranet)
  • Copy the /dist-php/config/theme-base/config.php file into the new directory
  • Open the /dist-php/config/{new theme}/config.php file
    • Change the $_SITE['wb_theme_folder'] = "/theme-base" to point to the new theme folder (i.e $_SITE['wb_theme_folder'] = "/theme-gcwu-intranet"
    • Change all variables prefixed with base_ to the prefix for the new theme (i.e $_SITE['base_cmblang_href_eng'] becomes $_SITE['gcwu_cmblang_href_eng'])

Theme Folder

  • Copy the /dist-php/theme-base folder and rename to the new theme name (i.e /theme-gcwu-intranet)
You might want to make sure to do a back-up or commit at this point, the next step could get messy
  • Do a mass find and replace on the /dist-php/{new theme} folder to replace all base- and base_ prefixes with the new themes prefix (i.e base_ becomes gcwu_)

Theme Demos

  • In the /demos-php/config directory create a folder for the new theme
  • Copy the /demos-php/config/theme-base/config.php file into the new theme config folder
  • Open the new /demos-php/config/{new theme}/config.php file and change the $_DIST_CONFIG_LOC_ variable to point to the proper /dist-php/config/{new theme}/config.php file.
  • In the /demos-php directory create a folder for the new theme (i.e /demos-php/theme-gcwu-intranet)
  • Copy the /demos-php/theme-base demos into the new theme demos folder
At this point you should be able to test the theme by entering your server address followed by /{WET dist folder}/demos-php/{theme}/index-eng.php. As an example http://localhost/wet-boew/demos-php/theme-gcwu-intranet/index-eng.php. It may not be completely correct and require cleaning up.
  • Next use the provided /demos/{new theme} files provided with the core WET frame work to update the theme specific files in the /dist-php/{new theme} folder. This is really a custom process and will vary based on the theme. Some will require adding additional links in the navigation area. Some will require adding logos and icons or modifying the content title.