[Typo3] multi language and menus

Wes Rood wes9999 at myfastmail.com
Mon Mar 21 06:46:29 CET 2005


I'm successfully getting multiple language content, however, there must 
be something wrong in my template script, because the menu items don't 
show in the alternate language unless I'm viewing a page that has an 
alternate language available.

I have a demo site up at http://typo3test.wdr.no-ip.com/, created from 
the Modern template building tutorial.  Please try it and see if you can 
help me.  The first 3 menu items (home, licensing, terms and conditions) 
have Spanish and Portugese translations available, however, the last 
item (privacy policy) has been created in english (default language) only.

I have a basic language switcher at the bottom of the page.

Everything works fine when switching languages and going through the 
first 3 menu items, but I run into problems when clicking on the 
"privacy policy" link.  It causes the top 3 menu items to switch back to 
english, even though the &L=1 or &L=2 is still present in my url.  
Clicking on one of them causes the translations to come back.

Shouldn't it continue to display the menu items in the alternate language?

Wes

my template:
------------------

# Configuring the Auto-Parser for main template:
plugin.tx_automaketemplate_pi1 {
    # Read the template file:
  content = FILE
  content.file = fileadmin/template/main/part1/template_1.html
 
    # Here we define which elements in the HTML that
    # should be wrapped in subpart-comments:
  elements {
    BODY.all = 1
    BODY.all.subpartMarker = DOCUMENT_BODY
 
    HEAD.all = 1
    HEAD.all.subpartMarker = DOCUMENT_HEADER
    HEAD.rmTagSections = title
 
    TD.all = 1
  }
 
    # Prefix all relative paths with this value:
  relPathPrefix = fileadmin/template/main/part1/
}
 
config.linkVars=L
[globalVar = GP:L = 1]
config.sys_language_uid=1
[globalVar = GP:L = 2]
config.sys_language_uid=2
[GLOBAL]

# Menu 1 cObject
temp.menu_1 = HMENU
  # First level menu-object, textual
temp.menu_1.1 = TMENU
temp.menu_1.1 {
    # Normal state properties
  NO.allWrap = <div class="menu1-level1-no"> | </div>
    # Enable active state and set properties:
  ACT = 1
  ACT.allWrap = <div class="menu1-level1-act"> | </div>
}
  # Second level menu-object, textual
temp.menu_1.2 = TMENU
temp.menu_1.2 {
    # Normal state properties
  NO.allWrap = <div class="menu1-level2-no"> | </div>
    # Enable active state and set properties:
  ACT = 1
  ACT.allWrap = <div class="menu1-level2-act"> | </div>
}

 
# 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
    # Select only the content between the <body>-tags
  workOnSubpart = DOCUMENT_BODY
 

     # Substitute the ###menu_1### subpart with dynamic menu:
  subparts.menu_1 < temp.menu_1
    # Substitute the ###content### subpart with some example content:
#  subparts.content = TEXT
  #subparts.content.value = HELLO WORLD - CONTENT
    # Substitute the ###content### subpart with some example content:
  subparts.content < styles.content.get

}
 
 
# Main TEMPLATE cObject for the HEAD
temp.headTemplate = TEMPLATE
temp.headTemplate {
    # Feeding the content from the Auto-parser to the TEMPLATE cObject:
  template =< plugin.tx_automaketemplate_pi1
    # Select only the content between the <head>-tags
  workOnSubpart = DOCUMENT_HEADER
}
 
 

 
# Default PAGE object:
page = PAGE
page.typeNum = 0
 
# Copying the content from TEMPLATE for <body>-section:
page.10 < temp.mainTemplate
 
# Copying the content from TEMPLATE for <head>-section:
page.headerData.10  < temp.headTemplate






More information about the TYPO3-english mailing list