Global Areas for each language section

This tutorial is over a year old and may not apply to your version of Concrete CMS.
Dec 22, 2014

This is the my solution to generate Global Areas for each language section, for 5.7.

Create application/src/Area/GlobalArea.php as below

<?php
namespace Application\Src\Area;

use Concrete\Core\Area\GlobalArea as CoreGlobalArea;
use Concrete\Core\Multilingual\Page\Section\Section as MultilingualSection;
use Localization;
use Punic\Language;
use Punic\Data;

class GlobalArea extends CoreGlobalArea
{
   public function __construct($arHandle)
    {
        $ms = MultilingualSection::getCurrentSection();
        if (is_object($ms)) {
            $locale = $ms->getLocale();
        } else {
            $locale = Localization::activeLocale();
        }
        $fallbackLocale = Data::getFallbackLocale();
        if ($locale != $fallbackLocale) {
            $locName = Language::getName($locale, $fallbackLocale);
            $arHandle = $arHandle . ' ' . $locName;
        }
        $this->arHandle = $arHandle;
    }
}

Then modify your application/config/app.php

<?php
return array(
    'aliases' => array(
        'GlobalArea' => 'Application\Src\Area\GlobalArea'
    )
);
Recent Tutorials
How to Automate the Copyright Year
Dec 27, 2024

Learn how to keep your website's copyright year updated automatically in Concrete CMS.

How to change the path of a group of pages
Dec 23, 2024
By myq.

Change the canonical path without breaking things

Bi-directional Express associations
Dec 18, 2024
By myq.

Set up associations between Express entries in both directions

Display Express Data Across Multiple Sites
Dec 17, 2024
By myq.

A guide to configuring Express entities and the Express Entry List block to ensure proper data display across multiple sites.

Customize locale icons
Oct 29, 2024
By myq.

How to customize locale (language region) flags

Concrete CMS Caching Guide
Oct 16, 2024

An overview of types of caching in Concrete and considerations when using them.

Improvements?

Let us know by posting here.