[TYPO3] Simultaneous multi-language content?

JoH asenau info at cybercraft.de
Fri Feb 15 01:34:30 CET 2008


>>> Setting up a bilingual Typo3 site. We run news updates via tt_news,
>>> which works in both languages no problem. We also put our latest
>>> headlines on the front page, in both languages:
>>>
>>> News:
>>> Location(en)/Location(fr)
>>> Headline in English (links to article) / Headline in French (links
>>> to fr article)
>>>
>>> Is there any clever trick I could do to get the latest news from
>>> tt_news in both languages?
>>> We do something similar with the navigation - the front page
>>> displays each section in both languages, and then the person makes
>>> an implicit decision by clicking one, and thereafter the menu is in
>>> one language only. I tried to get a bilingual auto-generated menu
>>> by doing this in TS:
>>>
>>> config.sys_language_uid = 4
>>> config.language = fr
>    [snip]
>>> #set up english section
>>> config.sys_language_uid = 0
>>> config.language = fr
>    [snip]
>>> But no dice. I'm not the world's greatest expert in TS, but I figure
>>> that I'm taking the wrong approach to extracting content in a
>>> particular language. Any advice?
>
> It should indeed. I was swapping the order in the vague hope that it
> might make a difference, and forgot to switch that bit back when
> revising it for the mailing list message. It doesn't work even without
> that typo.

Well - TypoScript is no language but a configuration array with keys, values
and subarrrays.
In your case there's i.e. the key "config." containing a subarray.
This subarray got the key "sys_language_uid".
Now the first value is 4 but this gets overriden while parsing the
TypoScript setup, so the actual value will be 0 in the end.

This is a "last one wins" situation which is true for all keys of any
TypoScript setup.

But there might be a workaround, since you can use CONTENT instead of HMENU.
Advantage: You can change the language in the select statement without
having to change the config section of the page setup.
Disadvantage: The pages table is the only table that uses an overlay table
for the different languages, so it might be a bit tricky to get the correct
TS-setup for the non default languages.
Default language should be taken form the table "pages" but fields of other
languages must be fetched from the table "pages_language_overlay" while
still using the structure of the table "pages".

Maybe you can use a combination of both HMENU and CONTENT since it might be
easier to create the menu for the default language without the CONTENT
trick.

HTH

Joey

-- 
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your gob sometimes!)
Dieter Nuhr, German comedian
openBC/Xing: http://www.cybercraft.de
T3 cookbook: http://www.typo3experts.com
Jobs: http://www.professionals-only.com




More information about the TYPO3-english mailing list