To change the contexts of your Novius OS instance, edit the local/config/contexts.config.php file.
After installation, Novius OS is configured with three contexts, one site in three languages:
<?php
return array(
'sites' => array(
'main' => array(
'title' => 'Main site',
'alias' => 'Main',
),
),
'locales' => array(
'fr_FR' => array(
'title' => 'Français',
'flag' => 'fr',
),
'en_GB' => array(
'title' => 'English',
'flag' => 'gb',
),
'ja_JP' => array(
'title' => '日本語',
'flag' => 'jp',
),
),
'contexts' => array(
'main::en_GB' => array(),
'main::fr_FR' => array(),
'main::ja_JP' => array(),
),
);
Here is an example configuration with five contexts across three sites and three languages:
<?php
return array(
'sites' => array(
'main' => array(
'title' => 'Main site',
'alias' => 'main',
),
'mobile' => array(
'title' => 'Mobile site',
'alias' => 'Mobile',
),
'event' => array(
'title' => 'Event site',
'alias' => 'Event',
),
),
'locales' => array(
'en_GB' => array(
'title' => 'English',
'flag' => 'gb',
),
'fr_FR' => array(
'title' => 'Français',
'flag' => 'fr',
),
'es_ES' => array(
'title' => 'Español',
'flag' => 'es',
),
),
'contexts' => array(
'main::en_GB' => array(),
'main::fr_FR' => array(),
'main::es_ES' => array(),
'mobile::fr_FR' => array(),
'event::en_GB' => array(),
),
);
Here is an example configuration for just one site in one language:
<?php
return array(
'sites' => array(
'main' => array(
'title' => 'Main site',
'alias' => 'main',
),
),
'locales' => array(
'en_GB' => array(
'title' => 'English',
'flag' => 'gb',
),
),
'contexts' => array(
'main::en_GB' => array(),
),
);
By default, the first context will answer to the root of your domain, the following contexts in a site_code/language_code/ subdirectory (e.g.: main/es_ES/).
But for each context, you can choose the URI (including a domain and optionally a directory) it will answer to, by specifying it the the associated configuration array.
<?php
'contexts' => array(
'main::en_GB' => array(), // Uses the default domain
'main::fr_FR' => array(
'http://www.mysite.com/fr/',
),
'main::es_ES' => array(
'http://www.mysite.com/es/',
),
'mobile::fr_FR' => array(
'http://www.mysite.com/mobile/',
),
'event::en_GB' => array(
'http://www.mysite.com/event/',
),
),
Warning
If your main context (the first) has a fr/example.html page and your main::fr_FR context has an example.html page, their URLs are identical (ie: http://www.mysite.com/fr/example.html). In this situation, only the page of your main context will be accessible.
<?php
'contexts' => array(
'main::en_GB' => array(
'http://www.monsite.com/',
),
'main::fr_FR' => array(
'http://www.mysite.fr/',
),
'main::es_ES' => array(
'http://www.monsite.es/',
),
'mobile::fr_FR' => array(
'http://mobile.monsite.fr/',
),
'event::en_GB' => array(
'http://event.monsite.com/',
),
),
Note
Of course, your domains should also be properly configured in Apache.
<?php
'contexts' => array(
'main::en_GB' => array(
'http://www.monsite.com/',
),
'main::fr_FR' => array(
'http://www.mysite.fr/',
),
'main::es_ES' => array(
'http://www.monsite.es/',
),
'mobile::fr_FR' => array(
'http://mobile.monsite.fr/',
'http://www.monsite-mobile.fr/',
'http://www.mysite.com/mobile/',
),
'event::en_GB' => array(
'http://event.monsite.en/',
),
),
You will probably need to define, for each of your contexts, different URLs between your local (development) and production instances. You can do that using environment-specific config files.