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

SearchViewHandling

Summary

Sets if searches are handled by the search view or in the template.

Usage

SearchViewHandling=default|template

Description

This setting has two options

  •  default - The view code does the search and passes the result to template. The template is only responsible for displaying the result.
  •  template - The template does the search and passes the result back to the view code. This way you have to "program" the search yourself providing more flexibility.

This setting is taken in consideration in the default search templates, by the use of $use_template_search variable, as shown in the following example:

{def $search=false()}
{if $use_template_search}
    {set $page_limit=10}
    {set $search=fetch(content,search,
                      hash(text,$search_text,
                           section_id,$search_section_id,
                           subtree_array,$search_sub_tree,
                           class_id,$search_contentclass_id,
                           class_attribute_id,$search_contentclass_attribute_id,
                           offset,$view_parameters.offset,
                           publish_date,$search_date,
                           limit,$page_limit))}
    {set $search_result=$search['SearchResult']}
    {set $search_count=$search['SearchCount']}
    {set $stop_word_array=$search['StopWordArray']}
    {set $search_data=$search}
{/if}

Note: Some of the default search templates use an if condition, others use section. Be aware that section is an already deprecated template control structure. 

Frederik Holljen (01/03/2005 11:54 am)

Ricardo Correia (03/07/2013 4:18 pm)

Frederik Holljen, Ricardo Correia


Comments

There are no comments.