Hi All,
I've added this post here because although it is related to ML it is not about the MLE fork.
After trying out cmsms_mle and getting loads of problems with 404's and XML errors I wondered whether I could create a multi lang site without it. I did, and this is what I've done:
First, plan your site and create your templates. These are from templates I call index and index_fr:
Each template will display pages that you want including a link to the other language.
English tpl: {menu template=navigation items="services,news,contact-us,french"}
French tpl: {menu template=navigation items="services (fr),news (fr),contact-us(fr),english"}
Again the brackets are to show you that the French tpl should include the actual French menu text. The list of nav items are the content aliases which you'll make next.
Create your content like this. I've just used (fr) to denote that these words would actually be in French so your menu structure would be a mirror of the English but in your language.
Home
Home>Information
Home>Services
Home>Contact
Home(fr)
Home(fr)>Information(fr)
Home(fr)>Services(fr)
Home(fr)>Contact(fr)
You don't have to categorise you content if you don't want but it is easy on the eye and organised.
When you're adding your content make sure that you set the menu text to that of the language you're using and (IMPORTANT) set the page alias to the name of your language i.e. english, french or whatever. Also select the template you'd like to use. For english pages use the English tpl and for French pages use French tpl or whatever you need.
So your templates are setup to display the French menu items and a link to 'english' when using the French template and vis versa for the English menu items.
Then in your menu manager look for the code which displays the menu items. It'll look like this:
{$node->menutext}
and change 'menutext' to 'alias'. This is to ensure that the menu items look right i.e. home, information, contact us, french. The important one was 'french' which is set in home's alias otherwise it'd say home, information, contact us, home(fr) (this would really mean home for the french pages). So doing this in the menuamanager template that you're using sorts this out.
And that's it!
I'm pretty sure there are other/better ways but I think this is a great way for smallish sites with a few pages of info. It's not as impressive as cmsms_mle and there are no flags or anything like that but I'm sure that could be done too.
Having said all that I'd love to know why I'm getting intermittent 404 errors and XML errors in IE7 with cmsms_mle though! But this was a good workaround for the client I'm working with and got me out of a jam very quickly!
Sarah
Simple multi language for cmsms, have a look here
Re: Simple multi language for cmsms, have a look here
Hi,
I did something similar in setup, but added a few extras...
- In my template I referenced a second content block, named after the secondary language to have both the primary and secondary language content appear on the same page in the editor. This makes it very easy to translate the original into the secondary language as both are visible at the same time. The second content block is only referenced in a smart comment ensuring its never sent with the actual page
- I used the content aliases module and set all the secondary language pages to alias their primary language version but use the secondary language template. This template shows the secondary language content but not the primary language.
- Finally I made a user defined tag "language link" to create a link to the same page in the other language.
To work the language_link needs a cms_selflink created earlier in the template. That can be hidden if not required on the page.
I think that's all. I'm just in the process of creating a new similar site. If there are other requirements I'll add them to this thread.
I did something similar in setup, but added a few extras...
- In my template I referenced a second content block, named after the secondary language to have both the primary and secondary language content appear on the same page in the editor. This makes it very easy to translate the original into the secondary language as both are visible at the same time. The second content block is only referenced in a smart comment ensuring its never sent with the actual page
- I used the content aliases module and set all the secondary language pages to alias their primary language version but use the secondary language template. This template shows the secondary language content but not the primary language.
- Finally I made a user defined tag "language link" to create a link to the same page in the other language.
Code: Select all
global $gCms;
$db = &$gCms->GetDb();
$smarty = &$gCms->GetSmarty();
$pageinfo = &$gCms->variables['pageinfo'];
$id = $pageinfo->content_id;
$isContentAlias = preg_match('/\balias_target\b/',join(',',$pageinfo->content_props));
if ($isContentAlias) {
$sql = 'SELECT content AS "LANG_ID" FROM '.cms_db_prefix().'content_props WHERE prop_name="alias_target" AND content_id=? LIMIT 1';
} else {
$sql = 'SELECT content_id AS "LANG_ID" FROM '.cms_db_prefix().'content_props WHERE prop_name="alias_target" and content=? LIMIT 1';
}
$row = &$db->GetRow($sql, array($id));
if ($row) {
$lang_id = $row['LANG_ID'];
# check if the page exists in the db
$manager =& $gCms->GetHierarchyManager();
$node =& $manager->sureGetNodeByAlias($lang_id);
if (isset($node)) {
$content =& $node->GetContent();
if ($content !== FALSE && $content->Active() && $content->HasUsableLink()) {
// echo $content->GetUrl();
$params['page'] = $lang_id;
if (function_exists('smarty_cms_function_cms_selflink')) {
echo smarty_cms_function_cms_selflink($params, &$smarty);
} else {
echo 'cms_selflink not loaded. create a selflink earlier on the page to ensure it will be loaded.';
}
} else {
echo '-';
}
} else {
echo '-';
}
}
I think that's all. I'm just in the process of creating a new similar site. If there are other requirements I'll add them to this thread.
Re: Simple multi language for cmsms, have a look here
Hello,
thank you for your tips.
Sarah, what a light-pretty-clever workaround with the regular CMSms.
BTW... Information, Services, Contact : your site was already both English and French
Chris, you remind me of http://forum.cmsmadesimple.org/index.ph ... 099.0.html
Pierre M.
thank you for your tips.
Sarah, what a light-pretty-clever workaround with the regular CMSms.
BTW... Information, Services, Contact : your site was already both English and French

Chris, you remind me of http://forum.cmsmadesimple.org/index.ph ... 099.0.html
Pierre M.
Re: Simple multi language for cmsms, have a look here
I did it like this....
http://forum.cmsmadesimple.org/index.ph ... 805.0.html where the first UDT isnt required, but mainly used to push the user to its own language-page, when it exists, else it goes to the default-page.... Flags are there to go to other langs...
And have a running example at http://baltus.krijt.eu/cms/
Ronny
http://forum.cmsmadesimple.org/index.ph ... 805.0.html where the first UDT isnt required, but mainly used to push the user to its own language-page, when it exists, else it goes to the default-page.... Flags are there to go to other langs...
And have a running example at http://baltus.krijt.eu/cms/
Ronny