5.1.2 Defining sites
Sites are defined by creating a directory for the site and putting a siteconf.xml file in it. This directory should be created in the "sites" directory. By default, this sites directory is located at:
The location of this directory can be changed in the cocoon.xconf.
The content of the siteconf.xml file should strictly adhere to a certain schema, otherwise the site will be ignored (in that case, an error will be logged in Cocoon's log files). An example siteconf.xml is displayed below.
<siteconf xmlns="http://outerx.org/daisy/1.0#siteconf"> <title>foobar</title> <description>The "foobar" site</description> <skin>default</skin> <navigationDocId>1</navigationDocId> <homepageDocId>2</homepageDocId> <!-- homepage>....</homepage --> <collectionId>1</collectionId> <!-- collectionName>myCollection</collectionName --> <contextualizedTree>false</contextualizedTree> <navigationDepth>4</navigationDepth> <branch>main</branch> <language>default</language> <defaultDocumentType>SimpleDocument</defaultDocumentType> <publisherRequestSet>default</publisherRequestSet> <siteSwitching mode="all"/> <newVersionStateDefault>publish</newVersionStateDefault> <locking> <automatic lockType='pessimistic' defaultTime='15' autoExtend='true'/> </locking> </siteconf>
- title: a (typically short) title for the site.
- description: a description for the site, shown on the sites overview page
- skin: the skin to use for this site
- navigationDocId: the ID of the navigation document
- homepageDocId: the ID of the homepage
- homepage: a path to the homepage, used instead of the homepageDocId. Usually this is a path to a Wiki extension (ext/something)
- collectionId: the ID of the default collection for the site
- collectionName: the name of the default collection of the site. Will only be used when collectionId is not set. (starting version 2.0.1)
- contextualizedTree: true or false. Indicates whether the navigation tree should be shown in full (= when false), or if the navigation tree should only have open branches leading to the selected node (= when true)
- navigationDepth: always displays the first n levels of the navigation tree. When using this with contextualizedTree=true then the first n levels will always be shown no matter what and more may be shown as you progress through the navigation. When using contrextualizedTree=false then only the first n levels will be shown no matter at what place the current document happens to be in the navigation.
- branch: default branch for the site (specify either the branch ID or name)
- language: default language for the site (specify either the language ID or name)
- defaultDocumentType: the default document type for this site (optional). The document type can be specified either by ID or by name.
- publisherRequestSet: which publisher request set to be used for the
- siteSwitching: defines if the browser should be redirected to another site
if a document is better suited for display in another site. Valid values for the
mode attribute are: stay (never switch to another site), all (consider all
available sites as sites to switch to), selected (consider only selected sites,
listed in <site> child elements inside the <siteSwitching> element).
For more information see
- newVersionStateDefault: publish or draft. This indicates the default state of the "Publish changes immediately" flag on the edit screen.
- locking: the locking strategy to use. To use no locking at all, remove the <automatic> element (but leave the empty <locking> element). To use warn-locking, ie only warning that someone else is editing the page but still allowing concurrent edits, change the lockType attribute to "warn".
Thus to create a new site, all you need to do is create a new subdirectory in the sites directory and put such a siteconf.xml in it.
Changes to the sites configurations are automatically picked up, it is not needed to restart the Daisy Wiki. It can take up to 10 seconds before Daisy notices your changes (this interval is configurable in the cocoon.xconf). If you don't see a site appearing, check the cocoon log files for errors.
The list of sites displayed to the user is filtered based on whether the user has access to the homepage document of the site. In case a custom homepage path is used (<homepage> instead of <homepageDocId>), you can still specify the homepageDocId to cause filtering. If this is not done, the site will always be displayed in the list.