2

Hi I'm creating a site that will be used in 4 locales which each have their own domain.

  • Australia: project.com.au
  • New Zealand: project.co.nz
  • South Africa: project.co.za
  • USA: project.co

In short, from a content management perspective I only want two locales. English AU and English USA. However, I need the content on the au locale to be accessible from the au,nz,za domains.

Is it possible to have an array of URL for one locale config?

1 Answer 1

1

Use a Multi-Environment configuration to set the siteUrl for your two locales, en_au and en_us, independently for each domain like so:

'project.com.au' => array(
    'siteUrl' => array(
        'en_au' => 'http://project.com.au/',
        'en_us' => 'http://project.co/',
    ),
),

'project.co.nz' => array(
    'siteUrl' => array(
        'en_au' => 'http://project.co.nz/',
        'en_us' => 'http://project.co/',
    ),
),

'project.co.za' => array(
    'siteUrl' => array(
        'en_au' => 'http://project.co.za/',
        'en_us' => 'http://project.co/',
    ),
),

'project.co' => array(
    'siteUrl' => array(
        'en_au' => 'http://project.com.au/',
        'en_us' => 'http://project.co/',
    ),
),

You can also set additional environment / domain specific variables in the config file. You could set the currency or the timezone for each domain:

'project.com.au' => array(
    'currency' => 'AUD',
    'timeZone' => 'UTC+10',
    'siteUrl' => array(
        'en_au' => 'http://project.com.au/',
        'en_us' => 'http://project.co/',
    ),
),

This is how you access such a variable in your templates:

{{ craft.config.currency }}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.