Site pages

Site pages represent text based documents that can be managed by Webpagebytes CMS.

The admin web interface allows to create, edit and delete the site page records.
Some examples of text based document are: a web site page with text/html content type, a web site style page with text/css content type, a body html for an email message.

A site page has the following attributes

Attribute name Attribute description
Site page description A text based description used for identification and used only in the admin interface for display purpose.
External Key The External Key identifier for the current site page.
Content type The value used on Content-type response header if the current site page is linked with a site url.
Source interpretation Specifies how the page content will be processed. It can have two values:
  • Plain text source. The page content will be processed as it is.
  • Template text source. The page content will be processed as a Freemarker template script.
Page model provider Custom server side code to generate the model data for the current site page.
Page content The page content in text based format. This can be plain text or Freemarker template script.

Site page template source

The site page source can contain Freemarker template script. A page can include multiple Page modules, which are smaller fragments of reusable text based content.
To include a page module just use the Fremarker <@wpbModule externalKey="..." />

Example of wpbModule usage.
	<@wpbModule externalKey="some_guid_1" name="header" />
	..main content goes here...
	<@wpbModule externalKey="some_guid_2" name="footer" />
The CMS engine will generate the content for this script fragment by replacing the wpbModule elements with the actual content of these page modules.

Site page customization parameters

Site page customization parameters are key-value pairs that are specific to the current page.
The customization parameters can be used only if the page source interpretation is template text, otherwise these will be ignored.
Page modules are common text content fragments that are reused across multiple site pages. Many times a page module output needs to be customized from page to page and the best way to achieve this is through the site page customization parameters.

For example a page module can be a main menu navigation, which is shared across multiple web pages. Each web page needs to display a different menu item selection, depending on the user navigation. To achieve this, each web page will define the same customized parameter (i.e. named 'selectionMenu') with the specific menu selection. The page module will contain Freemarker script that will take the selectionMenu value and will highlight the menu item corresponding to the parameter value.

See WPBModel.PAGE_PARAMETERS_KEY on how server side controllers can access a site page customization parameter.
See wpbPageParams model key on how a script code (site page or page module) can access a site page customization parameter.