This project is read-only.

XPath CheckBoxList

Uses an XPath expression to select nodes from the content tree to use as the checkbox options. The advantage of using XPath to define the nodes to use is that it allows a granular selection throughout the whole tree.

Can use $currentPage and also $parentPage within the XPath expression (including use within any XPath predicates). ($parentPage allows the expression to be evaluated when the current node is unpublished, and the XPath expression depends on finding nodes based on a current ancestor).

The property value stored can be a CSV string or an XML fragment of Node Ids or Node names.

Pre-value editor settings

Content editor

Example xml

<XPathCheckBoxList>
  <nodeId>1</nodeId>
  <nodeId>4</nodeId>
  <nodeId>5</nodeId>
</XPathCheckBoxList>

or

<
XPathCheckBoxList> <nodeName>Red</nodeName> <nodeName>Green</nodeName> <nodeName>Blue</nodeName> <XPathCheckBoxList>

uQuery

If node Ids are stored then the helper methods can also be used:

Node currentNode = uQuery.GetCurrentNode();

List<Node> colourNodes = uQuery.GetNodesByCsv(currentNode.GetProperty<string>("propertyAlias"));

or

List<Node> colourNodes = uQuery.GetNodesByXml(currentNode.GetProperty<string>("propertyAlias"));

 

Last edited Mar 2, 2011 at 10:57 AM by Hendy, version 9