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 ezpublish_legacy/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 ezpublish_legacy/extension/ezfind/design/ezwebin/templates/node/view/ezfind_line.tpl, where $node is an instance of eZFindResultTree)
Ricardo Correia (05/02/2013 2:12 pm)
Ricardo Correia (07/02/2013 4:23 pm)
Comments
There are no comments.