Partial Page Rendering URL - BloomReach Experience - Open Source CMS

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

26-04-2018

Partial Page Rendering URL

This feature is available since version 12.3.0

Introduction

In an advanced integration scenario, you might need to include a dynamic page fragment, maintained by WCMS (Web Content Management System), in an external web application such as E-Commerce websites. For example, only a specific portion of a product detail page at http://www.example.com/products/hippobloomy.html should be included in your E-Commerce website, excluding the top, menu and footer for instance, while keeping only the main content area of the page.

It is possible to define dedicated HST SiteMapItems and HST Pages separately for each includable page content for the external web application, but it is less convenient because you need additional configurations.

HST now supports partial page rendering URLs in a native way by allowing to specify "subPath" in navigational URLs. For example, a request on http://www.example.com/products/hippobloomy.html./main/content will render only the main/content component part, not the whole page. The "subPath" follows the delimiter, "./", after the normal navigational page URL.

SubPath to Specify Child Component Window Path

Suppose you have the following resolved component hierarchy for the page at http://www.example.com/products/hippobloomy.html:

/productpage:
  jcr:primaryType: hst:component
  # SNIP
  /top:
    jcr:primaryType: hst:component
    # SNIP
  /menu:
    jcr:primaryType: hst:component
    # SNIP
  /main:
    jcr:primaryType: hst:component
    # SNIP
    /content:
      jcr:primaryType: hst:component
      # SNIP
  /footer:
    jcr:primaryType: hst:component
    # SNIP

The component hierarchy for the page could be visualized like the following, too:

____________________________________________
|                  top                      | 
|___________________________________________|
|           |             main              |
|           |     ______________________    |
| menu      |     |       body          |   |
|           |     |                     |   |
|           |     |_____________________|   |
|___________|_______________________________|
|                  footer                   | 
|___________________________________________|

If you want to include only main/body component window, then the request URL should be http://www.example.com/products/hippobloomy.html./main/body. Or if you want to include only menu component window, then the request URL should be http://www.example.com/products/hippobloomy.html./menu instead. So, if developers know how the components are hierarchically organized, then they can easily include partial page rendering URLs for integration with external websites without having to add any extra configurations for HST SiteMapItems and HST Pages.

SubPath Delimiter Configuration

By default, the subPath delimiter is set to "./" for good reasons. The default configuration are safer than any other choices in most cases. However, if you need to customize the subPath delimiter for some reason, you may add and customize the following property in /WEB-INF/hst-config.properties:

container.request.path.suffix.delimiter = ./
The subPath configuration is also used in Content/Context-Aware JAX-RS Services. So if you change the delimiter, make sure to use the same delimiter in both cases.
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?