Hi all, For a site we're building i'm trying to implement multi language with a language selector that goes to the same page (if exists). Now when creating a new language, i can copy the entire site from eg EN, set the new site to nl language en get going. However when i relate to the original, the nl site is indeed linked to the EN site, but the EN site was already linked to FR and DA. Now for the new NL site i have to manually create all the links. Is there an 'easier' way so when copying an entire site, also all the other relations get copied? I was also thinking of using an sql script to set the links. Any thoughts or suggestions?
just to confirm, your NL site is related to you EN one, but you also want it related to your FR and DA one is that right ?
if so i would suggest you go through the relations service to get the links.
While you could use this to create direct relationships between NL and FA/DA i think long term it might be more sustainable for you if instead your lookup code was to get the parent relation of the current page using:
var pagerelations = _relationsService.GetByChildId(yourCurrrentpageId)
So for an NL page this will get you the related pages from the parent (the EN site) and then use that to get the child relations of the EN page (so all the relations across the site).
foreach(var relation in pagerelations)
{
var languageRelations = _relationsService.GetByParentId(relation.ParentId);
}
this way you can do the copy and relate thing to create a new site, but you don't have to build relationships between everysite just the parent.
* *if you are on the parent page you should get nothing back for the first call to GetByChildId, but then the parentId call will still work with the current page id as the parameter
Multilingual Site
Hi all, For a site we're building i'm trying to implement multi language with a language selector that goes to the same page (if exists). Now when creating a new language, i can copy the entire site from eg EN, set the new site to nl language en get going. However when i relate to the original, the nl site is indeed linked to the EN site, but the EN site was already linked to FR and DA. Now for the new NL site i have to manually create all the links. Is there an 'easier' way so when copying an entire site, also all the other relations get copied? I was also thinking of using an sql script to set the links. Any thoughts or suggestions?
Thanks in advance!
Hi Stefan,
just to confirm, your NL site is related to you EN one, but you also want it related to your FR and DA one is that right ?
if so i would suggest you go through the relations service to get the links.
While you could use this to create direct relationships between NL and FA/DA i think long term it might be more sustainable for you if instead your lookup code was to get the parent relation of the current page using:
So for an NL page this will get you the related pages from the parent (the EN site) and then use that to get the child relations of the EN page (so all the relations across the site).
this way you can do the copy and relate thing to create a new site, but you don't have to build relationships between everysite just the parent.
* *if you are on the parent page you should get nothing back for the first call to GetByChildId, but then the parentId call will still work with the current page id as the parameter
is working on a reply...