webCOMAND

#CPATH

Process a cPath query and store the results in a variable, which can iterated over with #LIST.

Prototype

#CPATH($variable, $query)

Parameters

  • variable - The variable to store the cPath query results in.  The variable name should include the preceding dollar sign.
  • query - A string or variable with the cPath query.

Example

#/ Retrieve and list all Contacts from the repository.
#CPATH($Contacts,"FROM Contacts")
#LIST($Contacts)
<p>$FirstName $LastName</p>
#ENDLIST

Related

#LIST is used to iterate through the results.

#CQL and #SQL are similar to #CPATH, but process the corresponding type of query.