-
Notifications
You must be signed in to change notification settings - Fork 21
Setting up a new site v3.1
- Acquire the core WET v3.1 zip
- Acquire the PHP Variant for WET 3.1
- At the root of your web server create the directory /wet-boew
- Extract the wet-boew-dist-master.zip and copy the /dist folder into the /wet-boew directory
- Extract the wet-boew-php-master.zip and copy the /dist-php and /demos-php folders into the /wet-boew directory
To make sure the deployment is working before creating your own content using the Variant, it's recommended to get the PHP demos working to see if there are any configurations issues. Each of the Theme demos have a separate configuration file. Open each of the config.php files located in the /wet-boew/demos-php/config/{theme}/ directories. and set the $_ROOT_SERVER_DIR
variable to $_ROOT_SERVER_DIR = "/wet-boew";
where the /dist, /dist-php and /demos-php directories were deployed to.
Open a web browser and enter the domain of your server followed by /wet-boew/demos-php/index.php
. If the configuration paths are set correctly you should be greeted by the theme-gcwu-fegc splash page.
If the PHP demos worked correctly then you're ready to start development. There are a couple of key set-up features that will make updating the variant in the future just as easy.
For the sake of this example we'll be using the Government of Canada Web Usability Theme (GCWU)
At the root of your webserver, not in the /wet-boew directory, create a directory called /templates this is separate from the /wet-boew directory because it'll be specific to your site so if/when you want to blow away or update the PHP variant you won't have to worry about accidentally overriding you site specific variables. Copy the /wet-boew/demos-php/config/theme-gcwu-fegc/config.php file into the /templates folder just created. Update the variables in the file to reflect your site.
The splash page, also known as the welcome or site landing page, is by far the easiest to setup.
- Copy the /wet-boew/demos-php/theme-gcwu-fegc/1-master-php-template.php file to the root of your webserver and rename it index.php
- Open the index.php Set the
$_CONFIG_PATH
variable to$_CONFIG_PATH = $_SERVER['DOCUMENT_ROOT'] . "/templates";
- Entering the server domain and /index.php, for example
http://localhost/index.php
, should bring up the default theme-gcwu-fegc splash page.
Notice at the top of the index.php page the $_PAGE['lang1']
is set to "eng"
and the $_PAGE['lang2']
variable is set to "fra"
. This indicates the primary language for the page is English (eng) and the secondary language is French (fra). These variables are used frequently throughout the PHP Variant to automatically determine what values should be displayed when language is a factor. As an example the Following will demonstrate how to use the $_PAGE['lang#'] variables to set the title text on the splash page. For more information on variables and options they provide see the Variant Setup and Usage v3.1 Page
- Above the
$_PAGE['title_' . $_PAGE['lang1']]
variable add$_PAGE['issplash'] = "1";
This indicates the type of page template to be used should be the splash page.
- Set the
$_PAGE['title_' . $_PAGE['lang1']]
variable to$_PAGE['title_' . $_PAGE['lang1']] = "Welcome";
- Refresh the splash page. Notice the "Welcome" title is now displayed
- Copy the
$_PAGE['title_' . $_PAGE['lang1']]
variable and change it to$_PAGE['title_' . $_PAGE['lang2']]
- Set
$_PAGE['title_' . $_PAGE['lang2']]
to$_PAGE['title_' . $_PAGE['lang2']] = "Bienvenue";
- Refresh the page and notice the French text has been added.