custom queries: multiselect value's ranges

5 years 3 weeks ago - 4 years 11 months ago #3358 by bram

Currently the component only allows a single value per menu level. If you have the color on level3 the request can either be q3=red OR q3=blue. A query like q3=(red OR blue) is not possible.

This feature is a long outstanding request.

version 3.1914 prepares for the possibility to modify the queries passed to mysql and therefore allowing a query like the one above.

Main question right now is how to pass multiple values in the url. You can pass arrays to a variable using q3[]=red&q3[]=blue however that gets pretty ugly and long.

for the SEF urls we need a delimiter, example.com/red+OR+blue would be possible. Main problem is that the delimter, ' OR ' in the example is never used in any field or title.

having a shorter delimiter as ',' or '|' would be nice, but those occur in titles and fields quite often.

currently the importer strips some special characters, that might confuse joomla/mysql/php/http one of them is the ';', so the semicolon is never present in any field or title and it can be used as delimiter:

example.com/q3=red;blue

Or the pipe '|' is added to the list of magically stripped characters, and the pipe can be used as delimiter

After parsing the value to the component a helper function will create the custom query in the case of the example it would translate to

(color='red' OR color='blue')

However if it is a date field you could translate it to

(date after X AND date before Y)

or size

(length > X AND length < Y)

live example

zwangerschapskleding.co.nl/4-blauw;groen.html



There are still some issue, like url's getting way too long.

any thoughts how this feature should work?



  • Posts: 1494
  • Karma: 57
  • Thank you received: 247

  • Gender: Unknown
  • Birthdate: Unknown
  • Last Edit: 4 years 11 months ago by bram.

    Please Log in to join the conversation.

    5 years 3 weeks ago #3359 by bram

    navigation versus filtering.

    In the normal menu's of mod_datamenu you navigate the product, however having multi select is more like filtering: adding and removing options.

    If you just want to browse the catalog you want to navigate, and de-selecting options becomes anoying, right?

    I changed the layout a bit, now the multi select filters are grouped on top, and the menu's are used to navigate



  • Posts: 1494
  • Karma: 57
  • Thank you received: 247

  • Gender: Unknown
  • Birthdate: Unknown
  • Please Log in to join the conversation.

    Time to create page: 0.053 seconds
    Powered by Kunena Forum