Page Management - BloomReach Experience - Open Source CMS

This article covers a Hippo CMS version 10. There's an updated version available that covers our most recent release.

19-04-2016

Page Management

Webmasters can easily create, update and delete individual pages in the Template Composer.

The 'Pages' button in the template composer opens a list of all 'pages' in a channel. Click a page to open it. The list allows a webmaster to navigate to any page in a channel, even when a page is not reachable via the channel's regular navigation (e.g. landing pages).

Under the hood, a page consists of three parts:

  1. a page definition located below the JCR node  hst:pages,
  2. an explicit sitemap item; i.e. a sitemap item without any wildcards in its path,
  3. (optional) a relative content path pointing to the primary page document for this page (see the section 'primary document' below).

The list of pages therefore does not show _any_ and _default_ sitemap items, nor descendants of _default_ sitemap items.

Controlling the list of pages

It is possible to suppress sitemap items from being shown in the list of pages. This can be useful for technical sitemap items such as those for REST endpoints or RSS feeds. To suppress a sitemap item from the list of pages, add the property hst:hiddeninchannelmanager with value  true to the sitemap item such as in the following example:

+ hst:sitemap
  + rss
    - hst:hiddeninchannelmanager = true
    + _any_

Descendant sitemap items inherit the value hst:hiddeninchannelmanager from their parent item unless explicitly (re)defined. Sitemap items that are marked with the property 'hst:containerresource = true' are also not added to the list.

Adding a page

A webmaster can add new pages using the Add new page button. This button is shown below the list of pages, but only when the channel defines prototype pages. The prototype pages are located in the JCR node hst:prototypepages. 

The 'Add new page' button...

...is grayed out when the channel is in 'view' mode.
...is not shown when the channel does not define any prototype pages.

A webmaster can choose the page title, URL, and 'page template' (i.e. prototype page to copy) for a new page. Different templates typically have different styles, different default components, and/or a different layout of containers.

The URL of a page cannot contain the / character. To create a page at for instance http://localhost:8080/site/landingpages/mypage, first create a page with the url landingpages and then create a page mypage. When creating mypage, click the dropdown showing localhost and then select the item localhost/landingpages to nest mypage below landingpages. Note that it is only possible to nest pages below other pages that are part of the  hst:workspace.

When a new page is saved, the back-end performs the following steps:

  1. Copy the page prototype definition for the selected template to the pages in the workspace of the channel.
  2. Add an explicit sitemap item to the sitemap in the workspace of the channel, based on the URL of the page.
  3. Store the page title in the property hst:pagetitle of the created sitemap item.
  4. Link the created sitemap item to the copied page definition.
All configuration related to end-user created pages is stored in the workspace of a channel.

The new page will be put live when the webmaster publishes her changes.

Using the page title in a JSP

The title of a page can be used in a JSP template as follows:

<hst:defineObjects/>
The page title is: <c:out value="${hstRequestContext.resolvedSiteMapItem.pageTitle}"/>

Or in a Freemarker template as follows:

<@hst.defineObjects/>
The page title is: ${hstRequestContext.resolvedSiteMapItem.pageTitle?html}

The typical use case is to render the page title as a <title> tag in the HTML head:

JSP

<hst:defineObjects/>

<c:set var="pageTitle" value="${hstRequestContext.resolvedSiteMapItem.pageTitle}"/>

<c:if test="${not empty pageTitle}">
  <hst:element var="headTitle" name="title">
    <c:out value="${pageTitle}"/>
  </hst:element>
  <hst:headContribution keyHint="headTitle" element="${headTitle}"/>
</c:if>

Freemarker

<@hst.defineObjects/>

<#assign pageTitle=hstRequestContext.resolvedSiteMapItem.pageTitle />

<#if pageTitle??>
  <@hst.element var="headTitle" name="title">
    ${pageTitle?html}
  </@hst.element>
  <@hst.headContribution keyHint="headTitle" element=headTitle />
</#if>

Page Settings

The title and URL of the current page can be viewed via the 'Page Settings' item in the toolbar. When the channel is being edited and the current page is editable, the title and URL of a page can be changed.

A page is editable when it is stored in the workspace of a channel.

Changing the URL results in a new sitemap item. The old sitemap item will be marked as 'deleted', and removed when the changes are published.

Locking 

Editing settings of a page locks the whole page (i.e. its title, URL, and all containers on it). No other user can modify a locked page until the owner publishes her changes.

Primary document

For several reasons, it is desirable to associate a primary document with a page:

  • Linking to pages: the current link picker for documents does not yet support linking directly to (sitemap) pages. By setting the primary document, it is possible to link to a page by linking to its primary document.
  • Relevance: several collectors such as the TagsCollector use the bean returned by HstRequestContext#getContentBean() to populate the visitor data. By setting the primary document of a page, you can use that document to configure the metadata that should be added to the user profile when a visitor visits this page.
  • Influence link rewriting: technically, setting the primary document of a page sets the relative content path of the sitemap item to point to the selected document. By setting a document to be the primary document of a page, existing internal links in document, components, search results, etc. can be rewired to resolve to this page including a custom rendering rather than to a generic sitemap item and its generic rendering.

The dropdown contains a list of all documents linked to by the components on the page.

Assign a new template

A webmaster can assign a new template to an existing page. The back-end then performs the following steps:

  1. Copy the page prototype definition of the newly assigned template to the pages in the workspace of the channel.
  2. Link the sitemap item of the page to the new page definition
  3. Delete the old page definition, but keep its root node and mark it as 'deleted'

Pages marked as 'deleted' will be removed when the changes are published.

Reshuffling of container items when changing page templates

When a new page template is assigned to a page, the items in the containers in the old page definition are moved to the containers in the new page definition. The following rules are used to map items to new containers (the first matching rule wins):

  1. Items stay in containers with the same name
    When the new page definition has a container with the same JCR node name as a container in the old page definition, all items in it will be moved from the old to the new container. The order of the items will remain the same.
  2. Items move to the container designated as the 'primary' container
    Leftover items will be moved to the primary container of the new page definition. The primary container is defined by the property  hst:primarycontainer (part of the mixin  hst:prototypemeta) , and contains the path to the primary container relative to the root node of the page definition.
  3. Items move to the first container in the page definition
    Leftover items are moved to the first container in the page definition.

When the new page definition does not contain any containers, all container items in the old page will be deleted. This action can only be undone via 'Discard my changes', which will also undo all other changes in the channel. The user will be warned about this situation.

A page prototype without any containers is not recommended.

Deleting a page

A webmaster can delete the current page via the 'Page Settings' dialog. Only editable pages can be deleted. When a page is deleted, its sitemap item and page definition are marked as 'deleted'. They will be removed when the changes are published.

Renaming and/or moving a page

Available since Hippo 10.2.0.

Webmasters van rename and/or move editable pages. Renaming and moving can be done at the same time.

When a page is renamed or moved, any child pages (nested URL) also change their URL.

Copying a page

Available since Hippo 10.2.0.

Since CMS 10.2.0, webmasters can copy pages. Administrators can configure page copy and developers can hook into the page copy process.

Did you find this page helpful?
How could this documentation serve you better?
On this page
    Did you find this page helpful?
    How could this documentation serve you better?