Developer forum

Forum » Development » Filter the filteroptions

Filter the filteroptions


Reply
Hi

I have installed the filteroptions, but now get a list of al the groups, all the manufacturors, all the variants and in all the languages from all the shops that made in this project.

I was expecting that the filters made a look at the products that are loaded in the productlist (selected by the ecom module in the Admin) en create filters that are relative to to shown products?

Am I doing something wrong, or is the only way to make more filtergroups in the Admin, for each productoverview a new filtergroup?

Gr.
Martijn

Replies

 
Reply
Hi Martijn,

First of all please read my blog post regarding latest changes in the new search (the paragraph about default filtering in the frontend):

http://volpav.wordpress.com/2011/03/02/recent-changes-in-the-new-search-functionality/

Some filters allow you to configure what options should be displayed. For example, for the group filter you can specify the list of target groups.

The more generic solution would be to use "If" tags to exclude options with no products available (under the current view). For example, for the manufacturer filter the item template could look like the following:

<!--@LoopStart(Ecom:Filters.Manufacturers)-->
    <!--@If Defined(Ecom:Manufacturor.Total)-->
         <li>
            [.........]
        <li>
    <!--@EndIf(Ecom:Manufacturor.Total)-->
<!--@LoopEnd(Ecom:Filters.Manufacturers)-->


Hope this will help you.

-- Pavel
 
Reply

volpav.wordpress.com is no longer available.

 
Nicolai Høeg Pedersen
Reply
Oh - yes. We are on it...
 
Reply
Hi Pavel

Using the "If" statement to show on option in the filtering would be a nice solution.
But the problem is, it always returns an integer.
In my case all the options are being shown, because the total is always an integer with the value 0 or higher. (Using version 19.2.1.5)

Gr.
Martijn
 
Reply
You can use If and compare it with a literal value such as 0, as explained here: http://templates.dynamicweb-cms.com/TemplateTags/Dynamicweb-template-tags/General-tags/If-statements.aspx

Imar
 
Reply
Hi Imar

That's a new one for me, but very usefull.
I'll keep it in mind.

Thank you!

Martijn
 
Reply
Hi Martijn,

Yes, it's brand new; introduced in 19.2.1.3, and very useful indeed...

Imar

 

You must be logged in to post in the forum