Prototype Pages Configuration
Prototype pages are defined under the hst:prototypepages node. When you add a new page using the Experience manager, the system copies the selected prototype page to hst:workspace/hst:pages. The hst:prototypepages node uses the same node type as hst:pages, so it supports the same structure at the CND level. The relevant CND definitions are:
[hst:pages] > nt:base, mix:referenceable orderable + * (hst:abstractcomponent) [hst:configuration] > nt:base, mix:referenceable, mix:versionable // snip + hst:pages (hst:pages) = hst:pages + hst:prototypepages (hst:pages) = hst:pages // snip
However, hst:prototypepages has additional constraints on allowed node types.
Configuration Rules for hst:prototypepages
Prototype pages follow the same configuration rules as pages under hst:pages, with one exception: nodes of type hst:containercomponentreference are not permitted as descendants. A prototype page can include the following child node types:
hst:componenthst:containercomponenthst:containeritemcomponent
The following practices are recommended for most prototype pages:
Allowed Configuration for Prototype Pages
- A prototype can contain containers (
hst:containercomponentnodes). - A prototype can contain container items (
hst:containeritemcomponentnodes). - A prototype page can extend from an abstract page under
hst:abstractpages. Its descendant components can also extend components underhst:components. Technically, components can extend from pages underhst:pages, but this is discouraged.
Prototype Metadata
Prototype pages are structurally similar to regular page definitions under hst:pages, except for certain edge cases. You can also add prototype metadata to provide additional information about the prototype and its usage. The following metadata mixin is supported on prototype page nodes:
[hst:prototypemeta] mixin // the name to show for the prototype - hst:displayname (string) // the relative path to primary container - hst:primarycontainer (string)
If you set hst:displayname, the UI displays this value as the prototype name in Page Management.
Use hst:primarycontainer to specify which container receives leftover items when re-applying a prototype with multiple containers. Set this property to the relative path from the page to the container. For more details, see Reshuffling of container items when changing page templates in the Page Management documentation.
When you create a page from a prototype, the system removes the hst:prototypemeta mixin and its properties (hst:displayname and hst:primarycontainer) from the new page.
Example Prototype Configuration
/hst:prototypepages: jcr:primaryType: hst:pages /two-columns: jcr:primaryType: hst:component jcr:mixinTypes: ['hst:prototypemeta'] hst:displayname: Two columns hst:primarycontainer: main/content/right-container hst:referencecomponent: hst:abstractpages/base /main: jcr:primaryType: hst:component /content: jcr:primaryType: hst:component hst:template: two-columns.main.content /left-container: jcr:primaryType: hst:containercomponent /right-container: jcr:primaryType: hst:containercomponent
The hst:template property (two-columns.main.content) refers to a JSP or Freemarker template that includes the left and right containers. For example:
<div class="row-fluid"> <div class="span6"> <hst:include ref="left-container"/> </div> <div class="span6"> <hst:include ref="right-container"/> </div> </div>
Prototype Pages from Inherited Configuration
You can use prototype pages from inherited configurations. When you create a page from a prototype in an inherited configuration, the new page is stored in the project's workspace, not in the inherited configuration. The hst:workspace node is not inherited, as described in the Workspace configuration documentation.
Re-applying a Prototype with Container Items
The Page Management documentation explains how container items are "reshuffled" when you change page templates (prototypes). This process is called re-applying a prototype. If a page already contains items in its containers, re-applying a prototype does not add container items from the prototype to the existing page.
When you create a new page from a prototype that has container items, the system clones those items into the new page. However, when you re-apply a prototype to an existing page, the system does not copy any container items from the prototype.
Hint: When you re-apply a prototype to a page, any container items defined in the prototype are ignored.