26 Posts
kalemanzi
9 years ago
Topic

Hi there. 

I have looked around the forum but can't find the exact answer I am looking for.

I have a bunch of listings in categories based on provinces and cities. Then I make use of cascading multi to select the town / city in the end that correlates to the category id. I would like to filter my search results based on the category id on the last dropdown. 

I tried a hidden field of the jform catid field, and gave it a live value of my city/town value, but it does not seem to make any difference. Even if I alter the GET variables direct in the url, it just returns all the listings in alphabetical results and not listings only from that category. 

Maybe there is something obvious that I am missing?

Thanks

Any help appreciated.

Get a VIP membership
693 Posts
rpoy
9 years ago
1
Level 1

Hi kalemanzi,

What tables are you referencing in each search? My guess, is that there is no catid relationship in the table and so you may need to use a Free Query.

regards,

Randy

26 Posts
kalemanzi
9 years ago
0
Level 2

Hi Randy

Looks like I solved the initial problem, but I just found another issue with putting that same search in a module. 

I am supposed to have three modules next to each other, all with different seblod searches. 

I am using the stock #__content table, with art_catid (catid in table) in the search form as hidden field.

I managed to add an onchange to the javascript of second dropdown to set the value of category id select (jform) with getelementbyid. 

This works fine, and correct GET data appears in the URL. 

To get the query to do it's thing, I had to set art_catid to "exact"

I also had to hard refresh some old result pages, because the empty / incorrect results were cached

However, when I put this form in a SEBLOD Search module, and assign it to that menu item, the form never forwards me to the search page and I get no results. The current home page where the module appears is on the com_frontpage. 

I checked the settings in the module, it is pointing to the menu item where the search actually works, but it just does not redirect the user there when I press submit. It also does not show an Itemid in the url, even though the menu does have an itemid.

Do you have any idea how I can fix this or why the module would not be posting to the correct menu item / page?

26 Posts
kalemanzi
9 years ago
0
Level 1

Okay, I found the solution to modules in the old forum. You have to make some changes to the template.

I made a duplicate of the file \modules\mod_cck_search\tmpl\default.php and called it override.php

The Seblod search form uses these fields

Search for:
<input type="hidden" name="search" value="<?php echo $preconfig['search']; ?>" />
<input type="hidden" name="task" value="search" />


Replace the lines with:

<input type="hidden" value="com_cck" name="option">

<input type="hidden" value="list" name="view">

<input type="hidden" value="<?php echo $params->get( 'menu_item', '' ); ?>" name="Itemid">

<input type="hidden" value="<?php echo $preconfig['search']; ?>" name="search">

<input type="hidden" value="search" name="task">

In the SEARCH MODULE settings, go and change the template in advanced to your new template file.

Thanks to Cyril who posted the solution

Get a VIP membership