Jump to content

Split category select form element in Adv. Search module


Sebastian Schalipp

Recommended Posts

Hi,

 

The jReviews "category" select menue in the Advanced Search module shows all category levels in one long select menu, with the lower category levels slightly indented. With our category structure, this list gets too long to be usable.

 

What I would like to achieve instead, is to copy the behaviour of the same categories like on the Submit New Listing form (the "form chooser"):

Start with a select of the topmost categories, and dynamically load a secondary select with subcategories once a top category is selected.

 

I see two approaches:

 

1. Use the same mechanics as on the create php template. The "listing.submitCategory" javascript function that gets fired onChange of the first select used there is present in "jreviews.js" so it is already included in all output pages, it should be able to be used from the module template as well. However, a lot of additional scripting and class includes might be neccessary to actually make it work from within that module.

 

2. Write some custom php or JS functions within the advanced search module template or helper file, that takes to long category list and explodes/splits it into the various sub-groups, then create some JS to write the first select and the secondary (initially hidden) select menues for subcats. This might be done by using jQuery functions or plugins as jQuery is already loaded.

 

Work must be done by purely using Template Overrides, no core file must be altered.

 

If you like to do this, please give a time and cost estimate.

Looking forward to your message!

 

Thanks

Sebastian

Link to comment
×
×
  • Create New...