Developer forum

Forum » Development » Nested product filtering

Nested product filtering

Anders Ebdrup
Reply

Hello

 

Is it possible to have nested product filtering in Dw? So I can have a structure like:

  • filter 1
    • sub filter 1
    • sub filter 2
    • sub filter 4
  • filter 2
  • filter 3

And the "sub filters" should only be accesible when the parent is selected, e.g. "filter 1".

 

Best regards, Anders

 


Replies

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi Anders,

 

Yes, you can, by setting the Visibility options of the sub filters. Right-click the filter, choose Visibility options and then configure the rules for the visibility. More info can be found here: http://developer.dynamicweb-cms.com/documentation/for-developers/ecommerce/indexed-search/search-filters.aspx

 

Hope this helps,

 

Imar

 
Anders Ebdrup
Reply

Hi Imar

 

Thanks for quick reply! :-) I have read the documentation and it does not seem to support nested filtering?

From the link that you sent me I would like a structure like this:

  • [x] Accessories (27)
    • [ ] Cube (14)
    • [ ] Trek (13)
  • [x] Bikes (53)
    • [ ] Cube (5)
    • [ ] Trek (2)
    • [ ] ...
  • [ ] Campaign (1)
  • [ ] Clothing (41)
  • [ ] Components (39)

Above I have selected "Accessories" and "Bikes" and now for the "Bikes" I only want to display bikes manufactured by "Trek".

 

I have implemented the desired functionality here: http://go.rideforbund.dk/st%C3%A6vnekalender.aspx#StartDate=[19-04-2013|19-07-2013]&RegionId=[R01-05|R08-14]&DistrictId=[D02]&page=1&pagesize=30 - in the left hand side you can see that I have filtered by "Distrikt", but this is on a custom index

 

Anders

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply
This post has been marked as an answer

Maybe I don't understand your requirements, but:

 

If Distrikt 01-05 (Sjælland) is a value of the District filter

And Distrikt 01 through Distrikt 05 are individual filters,

 

then I can think it can be done.

 

Set the visibility options for Distrikt 01 through 05 to the value of Distrikt 01-05 of the Distrikt filter. Then they only become visible when that value is selected.

 

In order to display them as nested / sub filters you can override the filters in a custom filter file. E.g. rather than let Dynamicweb output all filters for you in a loop, you can set them explicitly. Alternatively, you could use a filter template that marks the filter as nested so you can influence it with CSS.

 

If this isn't what you're looking for, I don't think I understand what you're after.

 

Cheers,

 

Imar

 

Votes for this answer: 1

 

You must be logged in to post in the forum