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}
Using different Title fields for different languages
Re: Using different Title fields for different languages
{if $lang="en_EN"}{description}{else}{title}{/if}
edit : of course ==
edit : of course ==

Last edited by Jean le Chauve on Tue May 19, 2009 1:38 pm, edited 1 time in total.
Re: Using different Title fields for different languages
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
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
Re: Using different Title fields for different languages
Hi,
try this:
or
vilkis
try this:
Code: Select all
{if $lang eq "en_EN"}<title>{description}</title>{else}<title>{title}</title>{/if}
Code: Select all
{if $lang=="en_EN"}<title>{description}</title>{else}<title>{title}</title>{/if}
Re: Using different Title fields for different languages
fgrace, next time provide more informations (MLE for example) and appropriate forumfgrace 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, 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
Re: Using different Title fields for different languages
Hi
@vilkis - Your code worked perfect (using "en_US" language)
Thanks to all contributors for the information
regards
FG
@vilkis - Your code worked perfect (using "en_US" language)
Thanks to all contributors for the information
regards
FG