Name |
User |
A virtual page template is a template, that associates an HTML page with the data of a node of a particular base or primary node type and its relationships. Once a virtual page template has been created and published at /jcr:system/nodes/templateInstances you will get a virtual HTML page, whenever you access a node of the given node type.
To specify a new virtual page template, you must do the following steps
You create a virtual page template as described in the Create virtual page template use case. This includes the selection of the node type, for which the template will be made.
Then you can edit the template as described in the Use the HTML view use case, i.e. like an HTML page. This page is an example of the virtual pages, that will be created.
Next you associate elements of the page with properties of the node type or its descendant nodes and properties. For this, you use the context menu of the HTML element structure view of the explorer window. In the virtual page template editor, this view will be preselected.
The context menu includes
This can be handy, if you want all the elements (e.g. a heading and the subsequent paragraph) appear only in case a certain node or node property is present. In this case, you can associate the newly created DIV element to the appropriate node or property.
If you want to add a hyperlink or an image, that shall be associated to an element, please refer to the Insert hyperlink and Insert image use cases.
For each named query and for each newly created node type root you need to specify a query. To do that, use the view menu item Data binding.
A named query can be connected to an element mapped to a node property. The query should specify only a single result column. When using the template to edit data of a node, the editor will execute the named query and let the user select one of its results for the property value.
To edit a named query, select the query in the table and press Edit. The Structured search control will appear, please compare the Structured search action for details.
For each new node type root created using Map to new node type before, you must instruct the system about the relation to the primary node. This is called a secondary query.
There are two possible relationships:
In addition, you must specify the path where the external nodes can be found. This path will be used to create new external nodes as well, if you did not specify Select attribute for a hyperlink to the secondary query node type root.
These settings can be specified in the data binding editor:
Pushing the New or Existing button will show an Explorer dialog control to select the path. Invoking -> this or this -> will show the properties of the primary node type (when the primary node references the secondary node, use this ->) or the external node type (when the secondary node references the primary node, use ->this).
The editor will create an XSL stylesheet from the information entered, which will be used by the application to generate the virtual page. If you are familiar with XSL stylesheets, you can see the stylesheet by selecting XSL Stylesheet from the View menu.