Sites
Contents
Introduction
A highly central component of the XP CMS are sites. Site is shipped as a standard content type, which means it can easily be created and added by editors. Sites can also have applications assigned to them. Site applications are isolated from project applications. If a site should use an application already assigned to its project, you must assign the application directly to the site.
Whenever an app is added to a site, all functionality and all content types from the app will be available within the scope of the site.
Only applications that declare support for sites can be added. This is done via the descriptor file called site.xml
site.xml
The site form serves multiple purposes:
-
Declares that this app supports sites
-
Lets you to configure the application on a per site basis
-
Defines X-data mappings for the site
-
Defines bindings to Controllers as mappings and filters
The descriptor must be placed in your project as: src/main/resources/site/site.xml
<site>
<form/>
</site>
<site>
<processors> (1)
<response-processor name="tracker" order="10"/> (1) (2)
</processors>
<mappings> (2)
<mapping controller="/site/foobar/api.js" order="10">
<pattern>/api/v\d+/.*</pattern>
</mapping>
<mapping controller="/site/pages/default/default.js">
<match>type:'portal:fragment'</match>
</mapping>
</mappings>
<x-data name="seo-settings"/> (3)
<form> (4)
<input type="TextLine" name="company">
<label>Company</label>
<occurrences minimum="1" maximum="1"/>
</input>
<mixin name="address"/>
</form>
</site>
1 | Commonly used to add page contributions to the response |
2 | Controller and filter mappings definitions |
3 | Specify X-data fields to add across content types within the site |
4 | Define a form for this app. Used to add site specific configuration of the app |