Siblings

From OpenCms Wiki
Jump to: navigation, search

Siblings are similar to hard links in unix filesystems. There are two or more filesystem headers in different locations of the filesystem. Each of them has it's own file properties (although in opencms there can also be shared properties that are commonly used by all siblings that share the same content).

The content (e.g. a stream of XML data or an image) exists only once and is shared among all siblings. If the content of one is updated through one sibling, then all other siblings that use the same content are also affected.

Reasons for having two or more files with the same content but that may have different properties can be:

  • having the same content appear in different places of a website (copying wouldn't propagate changes in the file between copies)
  • having the same content behave differently in different places of a website: this is specially useful for multilanguage support, because the same xml file contains all the languages inside it but it's displayed in one or other language depending on the "locale" property.

Whenever two siblings share the same content, they must also have the same file type.

Practical example

Lets say you have a website called http://example.com. This site is build in English in the folder /en ==> http://example.com/en. Now you want to have your website in another language like German or French. All you do is create siblings of all your files in your /en folder. Set some properties (Please fix and name exact properties), update your opencms-system.xml to have more languages and fill your content. It does not matter if you fill in the German content on the English page, as long as you select the correct language in the drop down menu in the editor.
Sibling-language-select.png.

Now you can surf http://example.com/en with the English content and http://example.com/fr with the French content.

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox