webCOMAND

cObject::Keywords()

Access the object's Keywords, which are determined according to the following rules.

  • Keywords Template - If the object's content type defines a "Keywords" Template, it will be processed and the resulting output will be used. The result is also automatically cached to avoid unnecessary script processing.
  • Object Text Fields - If no Keywords method is defined, the text from all text-based fields will be combined to form the keywords.

Prototype

string Keywords()

Return

A string of space-separated keywords maintained in the repository.  These keywords are used by the search feature in the Collection Bar in List, Grid and other collection views as well as COMAND Search.  Keywords are also accessible using the .Keywords() query object method and MATCHES() function in a cPath or cQL expression.

Example

$repo = \comand::repo();
$object = $repo->get('FROM OID=123');
echo('Keywords: ' . $object->Keywords());