[solved]Babel: Page_lang not set

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
HarmO
Power Poster
Power Poster
Posts: 251
Joined: Thu Jan 26, 2012 3:22 pm
Location: Belgium

[solved]Babel: Page_lang not set

Post by HarmO »

I'm creating a multi language Site and i want to use only one template for more languages.

I also want to use the hierarchy to determine the language
the structure of my website:
  • home (root page)
  • NL (is a page)
    • test (is a page)
  • FR (is a page)
    • test fr (is a page)
so i discover the babel module. install it and follow the steps to implement it.

I have 2 activated languages:
  • fr_FR (= default language in babel module)
  • nl_NL
but it doesn't work. After loading {get_template_vars}, i see that the $page_lang stays empty.

Where did i go wrong?

Code: Select all

app_name = CMS
cgsimple = Object
sitename = ********
content_obj = Object
content_id = 155
page = fr
page_id = fr
page_name = fr
page_alias = fr
position = 4
friendly_position = 4
lang = en_US
encoding = utf-8
smarty = 
gcb_params = Array (1)
actionid = m46936
actionparams = Array (4)
returnid = 155
actionmodule = babel
menuparams = Array (4)
count = 3
nodelist = Array (3)
node = Object
page_lang = 
current_language = 
yah = 
SCRIPT_NAME = /index.php

Code: Select all

CMS Install Information
CMS Version		1.11.4

Installed Modules
CMSMailer			5.2.1
FileManager		1.4.3
MenuManager		1.8.4
ModuleManager		1.5.5
nuSOAP			1.0.2
Printing			1.1.2
Search			1.7.7
ThemeManager		1.1.7
TinyMCE			2.9.6
CGSimpleSmarty		1.4.10
CGExtensions		1.28.2
babel				0.4.1
FormBuilder		0.7.2
SiteMapMadeSimple	1.2.5
GBFilePicker		1.3.2
Showtime			2.0.4
Quotes			0.1.2
CMSPrinting		1.0.3
MicroTiny			1.2.5
News				2.12.10
Last edited by HarmO on Mon Feb 18, 2013 2:39 pm, edited 1 time in total.
Kind regards,
HarmO
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: Babel: Page_lang not set

Post by Dr.CSS »

Good chance it doesn't work with the latest version of CMSMS...

Last Release Date: 2011-01-16 (25 months ago)
faglork

Re: Babel: Page_lang not set

Post by faglork »

Dr.CSS wrote:Good chance it doesn't work with the latest version of CMSMS...

Last Release Date: 2011-01-16 (25 months ago)
I suggest using MleCms ... works well. Tip: One thing that is afaik not mentioned in the module help: you need to have the corresponding cmsms language packs installed.

http://blog.arvixe.com/creating-a-multi ... cms-module

Cheers,
Alex
HarmO
Power Poster
Power Poster
Posts: 251
Joined: Thu Jan 26, 2012 3:22 pm
Location: Belgium

Re: Babel: Page_lang not set

Post by HarmO »

Ok,

is there a possibility to get the first level parent?
because i just need an if / else solution....

in the style of

Code: Select all

{if $firstlevel_parent_alias = "nl" } do x
{elseif $firstlevel_parent_alias = "fr"} do y
{else} fallback solution z
{/if}
Kind regards,
HarmO
faglork

Re: Babel: Page_lang not set

Post by faglork »

HarmO wrote:Ok,

is there a possibility to get the first level parent?
because i just need an if / else solution....

in the style of

Code: Select all

{if $firstlevel_parent_alias = "nl" } do x
{elseif $firstlevel_parent_alias = "fr"} do y
{else} fallback solution z
{/if}
Did you read the link I posted? ;-)

--> $lang_parent

hth,
Alex
HarmO
Power Poster
Power Poster
Posts: 251
Joined: Thu Jan 26, 2012 3:22 pm
Location: Belgium

Re: Babel: Page_lang not set

Post by HarmO »

yes i did,

it was complicated but after re reading it, i managed to filter out what i needed.

So using the module CGSimpleSmarty and its tag

Code: Select all

{$cgsimple->get_root_alias()}
i created a variable "first_level_alias"

Code: Select all

{$cgsimple->get_root_alias() assign="first_level_alias"}
And then i can use simple if else statements like this

Code: Select all

{if ($first_level_alias == 'nl')}
{search resultpage="nl" search_method="post" submit="Zoeken" lang="nl_NL" searchtext="Zoekwoord"}
{else}
{search resultpage="fr" search_method="post" submit="Cherchez" lang="fr_FR" searchtext="Mot-clé"}
{/if}
Thanx for the feedback!
Kind regards,
HarmO
Post Reply

Return to “Modules/Add-Ons”