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
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

Express Form Styling
Apr 11, 2024
By myq.

Different ways to style Express forms

Setting addon/theme version compatibility in the marketplace
Jan 9, 2024

For developers worn out with setting the latest addon or theme version manually across too many core versions, here is a JavaScript bookmarklet to do it for you.

How to get the locale of a page
Jan 8, 2024
By wtfdesign.

Now, why don't we just have a getLocale() method on Page objects beats me, but here's how you work around it

Using a Redis Server
Jun 16, 2023
By mlocati.

How to configure Concrete to use one or more Redis servers to persist the cache.

Improvements?

Let us know by posting here.