How to create a filter form

How to create a filter form

Tuesday 19 August 2008 12:22:35 am - 1 reply

Author Message

Gabriel Finkelstein

Thursday 21 August 2008 11:52:09 am

You should do something like:

<form action="{$node.url_alias}" method="GET">
   <select name="(location)">
      {foreach $locations as $location}
         <option value="{$location.id}">{$location.name}</option>
      {/foreach}
   </select>
   <input type="submit" value="Filter" />
</form>

{def $salons=fetch(content, list, hash( parent_node_id, $node.node_id,
                                                       attribute_filter, array( array('salon/location', '=', $view_parameters.location) )}

$location is just an example. Instead you could loop through a ezselection or ezobjectrelation class attribute.
You should also consider when $view_parameters.location is not defined (the list is unfiltered).

You must be logged in to post messages in this topic!

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.