URLs and Languages

How does ProCMS provide content in multiple languages?

The straight answer is that it doesn't!

It does provide a multilingual interface in the Administration side of the system, translating the menus and page information into many languages.

The Pages and Navigation for the content pages in the version you are using have been extended to utilise the Admin languages.  By separating Pages and Navigation entries into sections based on the languages, you can provide the web visitor with pages in as many languages as you want.

In the Administration, under Settings->General you will see a little way down the options, a set of tick boxes for the system languages.  Every language that is selected will appear as a flag at the end of the menu on a visitors web page.  That flag will link to the same page in the language selected.

How can there be multiple home pages?

Simply, there can't.  There is only one Home page for the system.  In a multilingual system that page is one with no web content, just a very important tag to the Language Module:

{{ language:users_language }}

The module inspects the request for the Home page from the visitor's browser and gets their preferred language setting. It then redirects the page request to the Home page within the languages being used in the system.

How do I group Pages for languages?


How do I group Navigation for languages?

Here at the top of the Pages structure, you see the "real" Home page - marked as something that must be there and not removed!

Below you see the entries for the three languages in use, and within the English structure, you can also see the English Home Page that site visitors will see.  Also within the English section, there are of course the actual content pages for the language.

Above you see how the language section Page entry is configured. 

  • The Page Title is "English", only seen here in the Admin pages. 
  • The Status of the Page should be "Draft" as the page will have no content, is not seen on the web and is only used as a structural element.
  • The Slug is changed from what naturally forms when you create the entry to just the two character identifier used in the system for the language.

By setting the Slug as above, all Pages within this section structure will have Slugs that start with "/en" followed by their page Slug.  In the same way, Pages in the Greek and German sections will start with their abbreviation of "/el" and "/de" respectively.

How does the system switch to the same page in a different language?

Using the above structure of language pages and sub pages, any page with the same name in another language can simply be accessed.

Explaining that more fully, it's the Slug for the Pages that must match to make the switch, the Page title can and should be, in the language being used.  So for example, a "Contact Us" Page would have these entries:

Here you see the Greman entry with the Slug "/de/contact-us".  The three Slugs would be

  • /en/contact-us
  • /de/contact-us
  • /el/contact-us

Now you can see that by changing the first segment of the URL with the appropriate language abbreviation the system can easily switch the page to another language if it exists of course. 

The most important part here is that the Slug for equivalent pages must match exactly.

What about Navigation, the menu entries?

Once you have the structure of Pages correctly set, the entries in the Navigation simply match the Page structure.  In the Group area, the place where the menu is being displayed, you create Groups for each language.  The name of the Group must be "Header-" followed by the language abbreviation.  So for the three languages, you have "Header-en", "Header-de" and "Header-el".  Within these, you add the Pages you want to be displayed in the menu on the web page, again structured to appear logically for the web visitor.