Home : OpenEdit SDK : Programming OpenEdit : Page Properties
Page Properties
Each page can have properties associated with it. This allows you to insert data into the HTML.
Defaults
You can add properties at any level in the file system. A property will default to the _site.xconf file unless there is more specific xconf file.
Example
Here we can defined a top level property in /_site.xconf
<property name="title">ACME Demo</property>
So a page can do something like this:
<h3>$content.title</h3>
To echo back the value of the property.
less than symbol with < and the greater than symbol with >
So instead of putting the link in like this
<property name="title"><a href="/link/to/acme.html">ACME Demo</a></property>
It should be like this:
<property name="title"><a href="/link/to/acme.html">ACME Demo</a></property>
Multiple Language Support
<property name="title">
<value>Translation Worksheet</value>
<value locale="es" >Tabla de Traducir</value>
</property>
This will by default use the servers java.util.Locale to determine what language should be used.
The format of a local is language_country_variant Some example locale's are:
German: de
Simplified Chinese: zh_CN
Traditional Chinese: zh_TW
French: fr
See [http://www.loc.gov/standards/iso639-2/englangn.html] and [http://www.iso.ch/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html]
Dynamic Language
If you do not want to use the Locale of the machine then you can specify a language for each user.Each user should have a "locale" property with their specific language. It will look for a property as specific as it can find otherwise will default to the closest match.
<h2>$content.getProperty("title",$user)</h2>
