#1 2016-05-09 10:32:38

werd
Member
From: Riga, Latvia
Registered: 2016-05-09
Posts: 7

Override <ion:url/> to set domain specific URL

Hi,

we are building a site using IonizeCMS 1.0.8.1. We have 3 languages e.g. "en", "de" and "fr"
Normally the URLs are like this:

We have dedicated domain for each language(country) so we would need to somehow override IonizeCMS so that URLs are constructed like this:

How can this be accomplished? This must apply to all URLs globally.

Last edited by werd (2016-05-09 14:52:04)

Offline

#2 2016-05-11 12:41:34

otemu
Member
Registered: 2014-03-07
Posts: 183

Re: Override <ion:url/> to set domain specific URL

Hi,

Are you using 3 domains with 3 different hosts? Or 3 domains but just 1 host?

Offline

#3 2016-05-11 12:51:54

werd
Member
From: Riga, Latvia
Registered: 2016-05-09
Posts: 7

Re: Override <ion:url/> to set domain specific URL

Hi,

we will have 3 domains with the same host.

Offline

#4 2016-05-11 14:25:42

otemu
Member
Registered: 2014-03-07
Posts: 183

Re: Override <ion:url/> to set domain specific URL

So what happens when you use http://site.fr/fr/about? Does the site come up? Do you a get different language then expected?

Offline

#5 2016-05-11 14:35:09

werd
Member
From: Riga, Latvia
Registered: 2016-05-09
Posts: 7

Re: Override <ion:url/> to set domain specific URL

It works as expected. My question was about IonizeCMS core when URL's are constructed.
See example below.

I'm on a URL http://site.en/en/about and I about to switch language to "fr". The URL constructed via "<ion:language:url/>" is http://site.en/fr/about
I need to override it so that constructed URL is http://site.fr/fr/about

So basically when switching language I want to switch domain(preferably not loosing language specific URI).

Offline

#6 2016-05-11 17:35:26

otemu
Member
Registered: 2014-03-07
Posts: 183

Re: Override <ion:url/> to set domain specific URL

Hi,

Yes I understand now, the easiest way to override would be to write your own tag, so instead of using <ion:language:url/> you use your own custom tag <ion:domainlanguage:url/> or you could hack the core directly(not recommended).

If you look at
file:application/libraries/Tagmanager/Navigation.php
function:tag_language
Your get an idea of how the url is built, then copy it to your own custom tag and make your custom changes to resolve to the correct domain.

Offline

#7 2016-05-11 17:48:32

werd
Member
From: Riga, Latvia
Registered: 2016-05-09
Posts: 7

Re: Override <ion:url/> to set domain specific URL

Custom tag makes sense - thanks!

Offline

What's Ionize ?

Ionize is an Open Source Content Management System created by webdesigners for webdesigners.

Created and maintained by Partikule and Toopixel, Ionize wants to be the easiest and most powerful CMS.

Can I help ?

Because talent is nothing without involvement, we are looking for motivated coders and webdesigners to join the project team.

Resources

Website : ionizecms.com
Documentation : doc.ionizecms.com

Development : Ionize on GitHub
Translations : Ionize Translations