-
Notifications
You must be signed in to change notification settings - Fork 21
Variant Setup and Usage v3.1
The core distribution files reside in the /dist-php/inc folder. These files consist of all the common elements between each theme.
Place a file called bt_fa.php in each directory you want to include in the breadcrumb trail. In the file add
<?php $_NAVPATH['title_eng'] = "Title to display"; $_NAVPATH['link_eng'] = "/link/to/file.php' ?>Place
$_NAVPATH['title_']
and $_NAVPATH['link_']
variables in the file for each language supported by your site.
- Theme-base - Basic theme all variant themes are extended from
- Theme-gcwu-fegc - Government of Canada Web Usability Theme (gcwu-fegc)
- Theme-wet-boew - Basic Web Experience Toolkit Theme (wet-boew)
The variables in the PHP variant are broken into two groups the $_SITE and $_PAGE variables.
Site variables make up the bulk of the common text and links for the variant. The variables are initialized in the required configuration files that reside in the /demos-php/config directory. Originally the configuration files were in the /dist-php/ directory, but site variables are specific to a sites implementation therefore it makes more sense to distribute them with the demos. When implementing a site the user will have to override the variables in these files for their specific site. The User will be required to include one of the configuration files located in the /demos-php/config/{Theme} directories, which will set the theme for their site. The /demos-php/config/{Theme}/config.php files will pragmatically include the config.php file residing in the parent directory. Site variables are also used to set the path to the WET core distribution folder and the WET PHP Variant distribution folder. For more on setting configuraiton path see Setting PHP Variant Paths v3.1
The site variables in the /config/{theme} folder are used to set the theme specific $_SITE
variables. As an example the signature and WMMS logos for the GCWU theme are set in the /config/theme-gcwu/config.php file. Each of the /config/{theme}/config.php files must include the main /config/config.php file. There are very few variables a user would have to modify for the theme specific config files. Instructions are provided in each configuration file for what variables need to be override. As an example, the theme-gcwu-fegc config file has "Terms and Conditions" and "Transparency" links that need to be set.
There are several config files in the "root" configuration directory. The main file is the config.php with several supporting confg-{language}.php files, such as the config-eng.php file. The supporting config contain the language specific $_SITE
variables, which have to be overridden for specific site implementations. But not all the supporting config files are required, files are included from the main config.php file based on what $_PAGE['lang#'] options are set in a pages header. So if a site is only ever going to be in English and French then only the config.php, config-eng.php and config-fra.php files will be required. Theme config files are arranged so variables to be modified are located at the top of the file and will have comments beginning with "Modify".
Page variables are used to set required elements such as a pages title, modified date, issued date, the type of page template to use and whether to use a left side menu or not.
$_PAGE['lang1']
- sets the primary language for the current page normally will be $_PAGE['lang1'] = 'eng'
or $_PAGE['lang1'] = 'fra'
Language variables such as $_PAGE['lang1'] = 'eng'
should be set before the inclusion of the configuration files.
$_PAGE['title_eng']
or $_PAGE['title_fra']
- Sets the main title for the page
coding tip: Use$_PAGE['title_' . $_PAGE['lang1']]
to make the title dependent on the$_PAGE['lang1']
variable. Doing so will save time by allowing you to copy the page, change the$_PAGE['lang1']
to the alternate language and not have to retype all the _eng or _fra postfixes for each variable. see the Sample Template below
$_PAGE['modified']
- The date the page was last modified
$_PAGE['issued']
- The date the page was issued
$_PAGE['lang2']
- Sets the secondary language for the page
$_PAGE['version']
- When the application template is used by setting $_PAGE['isapp'] = "1"
then the $_PAGE['version']
value is displayed at the bottom of the content area instead of the date modified.
$_PAGE['short_title_eng']
or $_PAGE['short_title_fra']
- Sets a shorter title to be displayed above the content on the page. If the short title isn't specificity set then the corresponding required $_PAGE['title_']
variable will be used as the short title.
For information on setting up custom search features see Modular Search v3.1
Not setting one of these will use the default content page template
$_PAGE['isarchived']
- Use to apply the archive banner to archived pages
$_PAGE['isapp']
- Uses the application page template
$_PAGE['issplash']
- Uses the splash page template (No content is required in the main content area)
$_PAGE['isserv']
- Use the server page template.
$_PAGE['nosearch'] = "1"
turns off the search bar
$_PAGE['nolang'] = "1"
turns off the language selection
$_PAGE['nositemenu'] = "1"
turns off the mega menu (primary navigation)
$_PAGE['nobcrumb'] = "1"
turns off the bread crumb trail
Setting the $_PAGE['signin'] = "1"
or $_PAGE['signout'] = "1"
adds the sign in, sign out and account settings buttons to the right side of the content area next to the pages title. When these variables are used override the $_SITE['wb_signin_file_eng']
, $_SITE['wb_signout_file_eng']
, $_SITE['wb_sio_file_eng']
to respectively point to the PHP code governing the sign in, sign out and account settings behaviour.