Path

ez.no / documentation / extensions / ez publish extensions / ez find / ez find 2.4 / customization / customizing result templates


Caution: This documentation is for eZ Publish legacy, from version 3.x to 5.x.
For 5.x documentation covering Platform see eZ Documentation Center, for difference between legacy and Platform see 5.x Architecture overview.

Customizing result templates

Customizing result templates for eZ Find is similar to customizing templates for the regular search in eZ Publish, with the exception that eZ Find also offers some additional options. The eZ Find fetch function will return some extra information compared to the default search in eZ Publish, including:

  •  Relevancy ranking
  •  Language information
  •  Complete URLs to external results

The default search in eZ Publish returns a list of eZContentObjectTreeNode objects. To provide extra information, eZ Find returns a list of eZFindResultTree objects which contains the following extra attributes:

  •  is_local_installation : a boolean value indicating whether the result item is from the installation where the search was performed
  •  name: the language-dependent name of the result item
  •  global_url_alias: URL to the result item, including the protocol and domain name
  •  published: published timestamp
  •  language_code: result item language code
  •  highlight: text extracts that include the search terms
  •  score_percent: a relative value that indicates how well the result item matches the search terms

These values are accessible as regular attributes in the templates.

The default eZ Find result templates are stored in the extension/ezfind/design/standard/templates/content folder. Custom templates for the Website Interface are provided with eZ Find. An example of the result item is shown below:
 ( from extension/ezfind/design/ezwebin/templates/node/view/ezfind_line.tpl, where $node  is an instance of eZFindResultTree)

Geir Arne Waaler (06/06/2011 1:34 pm)

Geir Arne Waaler (06/06/2011 1:34 pm)


Comments

There are no comments.