[opencms-dev] multilanguage pages with different textbodies

Marian Kasala marian.kasala at apsoft.sk
Wed Sep 11 10:18:46 CEST 2002


Hello Thomas,

create your own class and use it as controlling class for your
multilanguage bodies then redefine body element something like this:


]]><ELEMENT name="langbody"/><![CDATA[

<ELEMENTDEF name="langbody">
 <CLASS>somepackage.BodyTemplate</CLASS>
</ELEMENTDEF>

Controling class might look like:

public byte[] getContent(CmsObject cms, String templateFile,
    String elementName,Hashtable parameters,
    String templateSelector)throws CmsException {

    ....
    ....
    templateSelector =  getCurrentLanguage() + "_BODY";

  return startProcessing(cms,templateDocument, elementName, parameters,
templateSelector);
 }

This way you can set template selector for appropriate language.

> does anyone of you has ever customized opencms in
> such a way, that you edit every page in multiple
> languages over different textbodies.
>
> For Examples 4 textbodies named:
>
> DE_BODY
> DE_HEAD ( every page has in every language 2 bodies. One for the headline
and one for the content)
>
> EN_HEAD
> EN_BODY
>
>
> If so, how do you deliefer the pages in the prefered language.
> I would have a language selector (listbox) on my navigation frame.
>
> I would be delighted if you could help me.
>
> Thomas

Best Regards,
   Marian Kasala


AP Soft GmbH
Zabinská 22
SK-911 05 Trencín

Tel.: +421 32 7435144
Fax: +421 32 7435144






More information about the opencms-dev mailing list