[TYPO3] How to change a source file based on language (L) value?

BMolayi at datacolor.com BMolayi at datacolor.com
Mon Feb 4 16:32:31 CET 2008


I have a one-tree multilingual site.

In the root template Constants field I have:

..............................................................

header.file = fileadmin/templates/test.html

..............................................................

 

And in the setup field I have:

............................................................

# Localization:

 config {

   linkVars = L

   sys_language_mode = content_fallback

   sys_language_overlay = 1

 }

 [globalVar = GP:L=1]

 config {

   sys_language_uid = 1

   language = ch

   locale_all = zh_CN

   metaCharset = iso-8859-1

 }

 [globalVar = GP:L=2]

 config {

   sys_language_uid = 2

   language = es

 }

 [global]

 

 

# Added by Bijan for realurl extension 1/17/08

config.simulateStaticDocuments = 0

config.baseURL = http://www.datacolor.com/

config.tx_realurl_enable = 1

config.uniqueLinkVars = 1

config.linkVars = L

 

 

# Configuring the Auto-Parser for main template:

plugin.tx_automaketemplate_pi1 {

 

  # Read the template file:

content = FILE

content.file = {$header.file}

  

  # Prefix all relative paths with this value:

relPathPrefix = fileadmin/templates/

 

}

 

# Main TEMPLATE cObject for the BODY

temp.mainTemplate = TEMPLATE

temp.mainTemplate {

 

    # Feeding the content from the Auto-parser to the TEMPLATE cObject:

template =< plugin.tx_automaketemplate_pi1

 

}

 

# Default PAGE object:

page = PAGE

page.typeNum = 0

page.10 < temp.mainTemplate

page.20 = USER

page.20.userFunc = tx_templavoila_pi1->main_page

page.30 < temp.tailTemplate

..........................................................

 

Right now, with the default language, the variable {$header.file}=
fileadmin/templates/test.html is used as the source for content in
template auto-parser.

What I want to do is, depending on the L value, change {$header.file}
value to:

For L=1             =>       header.file =
fileadmin/templates/test1.html

For L=2             =>        header.file =
fileadmin/templates/test2.html

etc.

 

I tried to insert these lines inside the condition block for each L
value, but it doesn't change the value of {$header.file}, and my
template remains the same. Could somebody tell me what's the best way to
do this?

 

Thanks,

 

 




The e-mail is intended solely for the person or entity to which it is addressed and may contain confidential and or privileged information. Any review, dissemination, copying, printing or other use of this e-mail by persons or entities other than the addressee is prohibited. If you have received this e-mail in error, please contact the sender immediately and delete the material from any computer.




More information about the TYPO3-english mailing list