[TYPO3-english] Jump to frontpage if page not translated

Andreas Burg typo3 at andreasburg.de
Tue Mar 24 19:05:25 CET 2009


Jeppe,

I hope it works, it's my langmenu, just styled and commented for everybodys use. The original works 
for me. I have not tested this one, maybe you can do it for me. Best viewed with syntax 
highlighting, it's not so difficult as it seams.

some config first:

config {
   # your lang IDs here, with fallback priority
   sys_language_mode = content_fallback ; 0,1
   sys_language_overlay = 1
   uniqueLinkVars = 1
   linkVars = L(0|1)
}

# Konfiguration Default English
config {
   sys_language_uid = 0
   language         = en
   # locale_all is server dependent
   locale_all       = en_GB.utf8
   htmlTag_langKey  = en
   headerComment (
     =========================================================
     *** Programmed by ... ***
     =========================================================
   )
}

# Konfiguration English
[globalVar = GP:L = 0]
config {
   sys_language_uid = 0
   language         = en
   # locale_all is server dependent
   locale_all       = en_GB.utf8
   htmlTag_langKey  = en
   headerComment (
     =========================================================
     *** Programmed by ... ***
     =========================================================
   )
}
[global]

# Konfiguration Deutsch
[globalVar = GP:L = 1]
config {
   sys_language_uid  = 1
   language          = de
   # locale_all is server dependent
   locale_all        = de_DE.utf8
   htmlTag_langKey   = de
   headerComment (
     ============================================================
     *** Programmiert von ... ***
     ============================================================
   )
}

# and the Object

lib.langmenu = HMENU
lib.langmenu {
   special = language
   #use your lang IDs
   special.value = 0,1

   1 = TMENU

   1.NO = 1
   1.NO {
     stdWrap.htmlSpecialChars = 1
     # a space between the flag icons
     allWrap = | |||
     # don't show any text within the link
     doNotShowLink = 1
     # put a flag icon in the link
     beforeImgLink = 1
     #normal flag, button style
     beforeImg = fileadmin/pics/flag_uk.gif || fileadmin/pics/flag_de.gif
     ATagTitle = Show english version || Zeige deutsche Version
     beforeImgTagParams = title="Show english version"  alt="Show english version" || title="Zeige 
deutsche Version" alt="Zeige deutsche Version"
   }

   1.ACT < .1.NO
   1.ACT {
     # flat flag icon, no link effect
     beforeImg = fileadmin/pics/flag_uk_f.gif || fileadmin/pics/flag_de_f.gif
     beforeImgTagParams = class="act_lang" title="You see the english version" alt="You see the 
english version" || class="act_lang" title="Sie sehen die deutsche Version" alt="Sie sehen die 
deutsche Version"
     doNotLinkIt = 1
   }

   1.USERDEF1 < .1.NO
   1.USERDEF1 {
     # flag button style, greyed out (dimmed). Note: You can also disable the link function here 
with doNotLinkIt, if you don't want that the user gets the site with a fallback language content, 
then use also a flat dimmed icon here.
     beforeImg = fileadmin/pics/flag_uk_d.gif || fileadmin/pics/flag_de_d.gif
     ATagTitle = No english version available yet || Zur Zeit keine deutsche Version verfügbar
     beforeImgTagParams = title="No english version available yet" alt="No english version available 
yet" || title="Zur Zeit keine deutsche Version verfügbar" alt="Zur Zeit keine deutsche Version 
verfügbar"
   }

   1.USERDEF2 < .1.USERDEF1
   1.USERDEF2 {
     # flat flag icon, greyed out (dimmed), no link effect (your are on the side without a 
translation, language fallback should work here for content)
     beforeImg = fileadmin/pics/flag_uk_d_f.gif || fileadmin/pics/flag_de_d_f.gif
     beforeImgTagParams = class="act_lang" title="No english version available yet" alt="No english 
version available yet" || class="act_lang" title="Zur Zeit keine deutsche Version verfügbar" 
alt="Zur Zeit keine deutsche Version verfügbar"
     doNotLinkIt = 1
   }
}

-- 
Andreas

Mailing list rules & guidelines (Mailing list Regeln & Leitfaden):
http://typo3.org/community/mailing-lists/
http://typo3.org/community/mailing-lists/mailing-list-rules-guidelines/


More information about the TYPO3-english mailing list