[TYPO3] Dynamicaly sorting HMENU.special = directory entries, multilingual
Christopher Torgalson
bedlamhotel at gmail.com
Sun Oct 22 19:25:32 CEST 2006
Hi,
On 10/22/06, Georg Skillas <gskillas at gmx.de> wrote:
> Hello everybody,
>
> being new to TYPO3 and after scanning several of the mailing list archives
> I am posting the question I could not resolve.
>
> I am building a Multilanguage site and have defined a menu in typoscript
> as follows (please use a fixed font for better readability):
>
> MENU = HMENU
> MENU {
> special = directory
> special.value = 4
> 1 = TMENU
> 1.NO = 1
> 1.NO.linkWrap = |
> }
>
> The structure of the menu is
>
> +-Menubar (uid 4)
> +-Aquaria
> +-Diving
> +-Sailing
>
> Every page of Aquaria, Diving and Sailing has translations pages in
> english (standard), german, greek. The pages have been arranged in
> alphabetical order of the title, this works nicely with one language.
> Is there a method to dynamicaly arrange the pages based on the page title
> in the respective language?
>
> For completenes, language selection hapens over the much used
>
> config.linkVars = L
> config.sys_language_uid = 0
> config.language = en
>
> ...
>
> LANGUAGE = COA
> LANGUAGE {
> 10 = TEXT
> 10 {
> field = uid
> wrap = <p><a href="index.php?id=|&L=1">Greek</a></p>
> }
> 20 = TEXT
> 20 {
> field = uid
> wrap = <p><a href="index.php?id=|&L=2">German</a></p>
> }
> 30 = TEXT
> 30 {
> field = uid
> wrap = <p><a href="index.php?id=|&L=0">English</a></p>
> }
> }
>
> ...
>
> [globalVar = GP:L=1]
> # Greek is needed
> config.sys_language_uid = 1
> config.language = gr
> [global]
>
> [globalVar = GP:L=2]
> # German is needed
> config.sys_language_uid = 2
> config.language = de
> [global]
>
> [globalVar = GP:L=0]
> # English is needed
> config.sys_language_uid = 0
> config.language = en
> [global]
Tyler's already answered your main question, but I just wanted to
point out that the way you're building links will eventually cause
problems if you ever use simulateStaticDocuments or RealURL to
generate more human-readable links (i.e. http://domain.com/foo.0.html
or http:domain.com/foo/bar/).
I'd construct the language links this way instead:
LANGUAGE = COA
LANGUAGE {
wrap = <ul>|</ul>
10 = HTML
10 {
value = Greek
value {
wrap = <li>|</li>
typolink {
parameter.data = field:uid
additionalParams = &L=1
}
}
}
20 < .10
20 {
value = German
value.typolink.additionalParams = &L=2
}
30 < .10
30 {
value = English
value.typolink.additionalParams = &L=3
}
}
--
Christopher Torgalson
More information about the TYPO3-english
mailing list