[TYPO3-english] Language Menu : help

Karl Wallace karl.wallace at roomthree.com
Fri Jul 29 12:46:42 CEST 2011


Hi Stefano

Here's some TS code I use that creates a menu that switches between English 
and Irish, it should suit you with some modifications. I hope it helps.

## Generate language switcher menu
lib.langmenu = HMENU
lib.langmenu {

special = language
special.value = 3
special.normalWhenNoLanguage = 0

wrap = <ul class="top-menu">|</ul>
1 = TMENU
1 { &nbsp; &nbsp; &nbsp; &nbsp;
# Normal link to language that exists:
NO = 1
#NO.allWrap = |*| | * &nbsp;|*| |
NO.linkWrap = <li> | </li>
NO.allStdWrap.insertData=1
NO.ATagParams = alt = "{field:title} Language Selector" title = 
"{field:title} Language"
NO.stdWrap.setCurrent = As Gaeilge
NO.stdWrap.current = 1 &nbsp; &nbsp; &nbsp; &nbsp;

# Current language selected:
ACT < .NOACT.linkWrap = <li style="background-color : red"> | </li> &nbsp; 
&nbsp; &nbsp; &nbsp;
# Language that is NOT available:
USERDEF1 < .NOUSERDEF1.linkWrap = <span style="background-color : yellow"> | 
</span>
USERDEF1.doNotLinkIt = 1
}
}

[globalVar = GP:L=3]
       lib.langmenu.special.value = 0
       lib.langmenu.1.NO.stdWrap.setCurrent = As Bearla
 [global]
## End of language menu

## Setting up default language
config{

 sys_language_overlay = content_fallback
 sys_language_overlay = 1
 linkVars = L
 language = gb
}

## Setting up Irish language, this checks the value of post variable L and 
sets the sys language
## depending on this

[globalVar = GP:L=3]
config{
 sys_language_uid = 3
 #language = ie
}

Cheers

Karl

"Stefano" <denebola75 at yahoo.it> wrote in message 
news:mailman.39496.1311925636.648.typo3-english at lists.typo3.org...
Hi Nicola :

Thanks for your answer : The reason is that i have no rule to choose plugins 
in this project (in this project there are involved many programmers) : so i 
need to develop a typoscript menu that follow the rules written before.

Any help will be apreciated.

Stefano.

--- Ven 29/7/11, Nicola Cerchiari <nicola.cerchiari at gmail.com> ha scritto:

Da: Nicola Cerchiari <nicola.cerchiari at gmail.com>
Oggetto: Re: [TYPO3-english] Language Menu : help
A: "TYPO3 English" <typo3-english at lists.typo3.org>
Data: Venerdì 29 luglio 2011, 09:10

Hi Stefano,
there's some specific reason why U would like to write your own typoscript?
Cause I know an extension that works pretty good and does exactly what you
are trying to achieve, maybe you should give it a try or a look for
inspiration: sr_language_menu

Bests,
2011/7/29 Stefano <denebola75 at yahoo.it>

> Hi all.
>
> I'm new in typo3, and i read many manuals about typoscript :
>
> I'm buliding a new site , that need 2 languages : italian and english.
>
> I have created the "one-tree-fits-all-languages" tree, accordingly to this
> tutorial
>
> http://typo3.org/documentation/tips-tricks/multi-language-sites-in-typo3/
>
> I need to write a typoscript code that create a language menu that shows
> only the exisiting language page (a page that is not translated in one of
> two language doesn't appear in menu)
>
> I wrote this typoscript code :
>
> ## menu1livello [BEGIN] ##
> lib.menu1livello = HMENU
> ##includeNotInMenu=1
> lib.menuprimolivello.entryLevel=-1
> lib.menuprimolivello.special=language
> lib.menuprimolivello.special.value = 0,1
>
> lib.menu1livello.1 = TMENU
> lib.menu1livello.1.NO {
> noLink = false;
> allWrap = <li class="livello1">|</li>
> }
>
> lib.menu1livello.1.ACT = 1
> lib.menu1livello.1.ACT {
> allWrap = <li class="livello1selezionato">|</li>
> }
>
> lib.menu1livello.1.CUR = 1
> lib.menu1livello.1.CUR {
> allWrap = <li class="livello1selezionato">|</li>
> }
>
> lib.menu1livello.1.USERDEF1 = 1
> lib.menu1livello.1.USERDEF1 {
> allWrap =
> doNotLinkIt = 1
> }
>
> But there is something that is doesn't wrote correctly
>
> Anyone could help me?
>
> Any help will be appreciated.
>
> Thanks in advance
> _______________________________________________
> TYPO3-english mailing list
> TYPO3-english at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english
>
_______________________________________________
TYPO3-english mailing list
TYPO3-english at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english 




More information about the TYPO3-english mailing list