""

How to create region specific pages

5 min read
This article shows how to make a variant page for use in a specific region

There are occasions when a page is required across multiple languages and regions, but with region specific information that applies only to that region and language. Some examples would be policy or contact pages.

This article explains how this is handled in Drupal.

As example we are are using a privacy policy page for a website that needs to show contact information for these countries:

  • Germany
  • Austria
  • France
  • Italy
  • Switzerland

The privacy policy page needs to be available in four languages:

  • German
  • French
  • Italian
  • English

The required country / language mapping will look like this - 

  • Germany - German | English
  • Austria - German
  • Switzerland - German | English | French | Italian
  • France - French
  • Italy - Italian

As the requirements for a privacy policy page are different for each country, there will need to be separate pages in some languages such as :

  • Germany - German language privacy policy
  • Austria - German language privacy policy
  • Switzerland - German language privacy policy
     
  • Germany - English language privacy policy
  • Switzerland - English language privacy policy
     
  • Switzerland - French language privacy policy
  • France - French language privacy policy
     
  • Switzerland - Italian language privacy policy
  • Italy - Italian language privacy policy
     

We will assume that the main language on our example site is German. As pages can be translated to another language a single page can be translated once. Our Germany privacy policy can be translate to each of the available languages

So that would be the main page (German) and the translations of that page - English | French | Italian

  • Germany - German language privacy policy
  • Austria - German language privacy policy
  • Switzerland - German language privacy policy
  • Germany - English language privacy policy
  • Switzerland - English language privacy policy
  • Switzerland - French language privacy policy
  • France - French language privacy policy
  • Switzerland - Italian language privacy policy
  • Italy - Italian language privacy policy

This means that we need to create additional pages for the remaining region / languages

  • Austria - German language privacy policy
  • Switzerland - German language privacy policy
  • Switzerland - English language privacy policy
  • Switzerland - French language privacy policy
  • Switzerland - Italian language privacy policy

To create a duplicate of the page, locate the page under Content > Overview

Using the drop down menu to the right of the filename, select Clone
Drupal will then make a complete copy of the page for you to work on.

""

Click edit into the newly created "cloned" page, and scroll to the bottom right of the page option to find the Region Settings

Under the region settings you should see the available regions. Select the region that the page should display for. In this example we are restricting this German language page to show in Austria only. 

A useful tip here is also to make some minor change to the page title so that you do not become confused between the original page, and its cloned page. This is only so you can work with the cloned page, and place it in a menu if needed. Once complete you can go back and change the page label again.

""

So we have created a new page in the correct language ( German ) and restricted it to show only in one country (Austria)

Next we much go back to the original page, and also change its region settings to a single country (Germany)
We need to do this so the original German page, does not also appear as well as our newly created page in Austria.

This is also a straightforward step - go to the original page, go to the Region Settings, and check (Germany)
Save your changes

Adding the page to a menu. 


The newly created policy pages can be placed in a menu exactly the same as any other page.
You may have a number of privacy pages listed in the menu, which can be disorientating - this is why its good to have some minor change in the page name so you can identify which page is which.

The Drupal platform will identify what page and language should be presented in the menu based on the language/region settings  applied to that page. 

Test the page/menu in a private browser window to ensure that you are getting the behavior that you want between the regions you select and the language that should be displaying. 

When you are happy that the page is working as intended - you can go back and adjust the page name of the cloned page you created so that it matches the naming convention you used on the page

TROUBLESHOOTING

Two pages are displaying in the menu
Make sure that the Region settings are correct in both the original page, and the cloned page you created. If a region is made available in one page, it needs to be restricted in the original