[opencms-dev] Determine Siblings - Multilingual Site

Jonathan Woods jonathan.woods at scintillance.com
Wed Sep 20 11:30:33 CEST 2006


Radu -
 
The CmsObject class has a useful method readSiblings(String resourceName,
CmsResourceFilter filter) which returns a list of all siblings of a
resource.  The list is a List of CmsResources, and includes the resource
corresponding to resourceName (a String which is the site-relative path to
the resource concerned).
 
Best way to get familiar with what the OpenCms Java API offers you is to
integrate it into your favourite development environment.  Or you can browse
Javadoc at e.g. http://www.opencms.org/export/javadoc/core/index.html.
 
Jon

  _____  

From: opencms-dev-bounces at opencms.org
[mailto:opencms-dev-bounces at opencms.org] On Behalf Of Radu Sora
Sent: 20 September 2006 09:39
To: opencms-dev at opencms.org
Subject: [opencms-dev] Determine Siblings - Multilingual Site


Hello,

I am trying to build a multilingual site with OpenCMS 6.2. So far I created
different folders for each language, and set the default locale for each. I
also created siblings in each language folder for each resource. Considering
i want to have different URLs for each language (and not follow a naming
convension like file_en, file_de etc.), to make the language switcher I have
to be able to determine all the siblings for file. 

For example, let's consider the following folder tree:

/en/ (default locale set on en)
   school.html
/fr (default locale set on fr)
   ecole.html (sibling -> /en/school.html)

What i need is a method to programmatically determine the list of sibling
for a specified resource, so i can put the language switch on all pages. 

Any clue?

Thank you,
Radu


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20060920/971d724c/attachment.htm>


More information about the opencms-dev mailing list