lundi 17 juillet 2017

Octobercms disable translations on a different domain

I'm trying to build a website wich can be accessed through the main domain, wich will use the main theme. But can also be accessed through different domains wich are saved in the database, these will use a different theme.

The problem i am having is that the main website uses the rainlab translations plugin wich automatically changed the normal url to url+locale. This is something i do not want to use in my other theme, wich result in a 404.

I change the theme in my own plugin like so:

$currentHostUrl = Request::getHost();

    Event::listen(
        'cms.theme.getActiveTheme',
        function () use ($currentHostUrl) {
            $domain = Domain::where('domain', $currentHostUrl)->first();
            if($domain !== null)
            {
                return 'differentTheme';
            }
        }
    );

This is based on the way keios made their multisite plugin.

I would like to know how i can stop the localisation url change when the other domains are visited.

I hope someone knows how to help me. Thanks in advance.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire