Using different Title fields for different languages

This is a FORK of the CMS Made Simple project and is not oficially supported in any way by the CMS Made Simple development team.
Locked
fgrace
Forum Members
Forum Members
Posts: 15
Joined: Mon Dec 15, 2008 8:35 pm

Using different Title fields for different languages

Post by fgrace »

Hi all
I'm quite new to CMSMS so please bare with me...i would be grateful for any help on this..

I am setting up a multilingual site with English as the main language and swedish, spanish etc. as secondary languages.
I wish to use the Description (title attribute) for the Titles on English pages, while using the main Title for all pages in other languages, how can this be achieved ?
e.g. If english then display description tag else display Main title

My template code looks like this:

{process_pagedata}



{title}
{* The sitename is changed in Site Admin/Global settings. {title} is the name of each page *}

{metadata}
{* Don't remove this! Metadata is entered in Site Admin/Global settings. *}



{global_content name='lang-stylesheet'}
{literal}
Jean le Chauve

Re: Using different Title fields for different languages

Post by Jean le Chauve »

{if $lang="en_EN"}{description}{else}{title}{/if}
edit : of course ==  ;D
Last edited by Jean le Chauve on Tue May 19, 2009 1:38 pm, edited 1 time in total.
fgrace
Forum Members
Forum Members
Posts: 15
Joined: Mon Dec 15, 2008 8:35 pm

Re: Using different Title fields for different languages

Post by fgrace »

Hi Jean

Thanks for your response. I tried the code you gave me, and although it appears to produce the correct title in the code..the page loaded with the following error:
string(114) "Smarty error: [in template:24 line 5]: syntax error: unidentified token '=' (Smarty_Compiler.class.php, line 1407)"
and the page design loaded incorrectly
vilkis

Re: Using different Title fields for different languages

Post by vilkis »

Hi,
try this:

Code: Select all

{if $lang eq "en_EN"}<title>{description}</title>{else}<title>{title}</title>{/if}
or

Code: Select all

{if $lang=="en_EN"}<title>{description}</title>{else}<title>{title}</title>{/if}
vilkis
alby

Re: Using different Title fields for different languages

Post by alby »

fgrace wrote: I am setting up a multilingual site with English as the main language and swedish, spanish etc. as secondary languages.
I wish to use the Description (title attribute) for the Titles on English pages, while using the main Title for all pages in other languages, how can this be achieved ?
e.g. If english then display description tag else display Main title
fgrace, next time provide more informations (MLE for example) and appropriate forum

fgrace, if you want a description for english ONLY (because you have 1 description only), use vilkis advice
if you want description for other languages (two or more) you must set MLE extended version (look for README.FIRST.extended file)

Alby
fgrace
Forum Members
Forum Members
Posts: 15
Joined: Mon Dec 15, 2008 8:35 pm

Re: Using different Title fields for different languages

Post by fgrace »

Hi

@vilkis - Your code worked perfect (using "en_US" language)
Thanks to all contributors for the information

regards
FG
Locked

Return to “[locked] CMSMS MLE fork”