Path

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


This is the old documentation center for eZ Publish 4. We are currently migrating the eZ Publish documentation to http://confluence.ez.no the eZ Publish 5 documentation platform. Documentation for the eZ Publish legacy components are still located on this site, as well as all documentation for earlier releases.

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)

Ester Heylen (15/07/2010 11:34 am)

Geir Arne Waaler (16/05/2011 11:43 am)

Ester Heylen, Geir Arne Waaler


Comments

There are no comments.