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
Upgrading Concrete from 8.5 to 9.x
Jun 21, 2024
By myq.

How to avoid problems upgrading from 8.5 to 9.x

How to change the default date format
May 30, 2024
By myq.

Change the format of the default date

WebOps Tutorial on Running and Upgrading a Concrete CMS Website
May 2, 2024
By myq.

Describes how to deploy, manage, and upgrade a Concrete CMS website

Using the Concrete Migration Tool Addon
Apr 27, 2024

How to use the Concrete CMS Migration Tool

Create custom Site Health tasks
Apr 19, 2024
By myq.

This tutorial will guide you through the creation of a new Site Health task

Reusing the same Express entity in multiple associations
Apr 11, 2024
By myq.

How to create and manage multiple associations in Express

Improvements?

Let us know by posting here.