Forums › Forums › Search & Filter Pro › Displaying results in relevant page
- This topic has 11 replies, 3 voices, and was last updated 10 years, 4 months ago by
Anonymous.
-
Anonymous(Private) October 21, 2015 at 2:56 pm #27852
Hi,
Just purchased the plugin after seeing how it is being used in another website, with success.So I’ve built a simple search form.
It has one field (select-box): cities
And two options for it: All cities, test-city (1 record)
City is a taxonomy I’ve created and the test-city page exists under mydomain.com/city/test-city (operated by the theme’s search.php)I tried to set the settings in the form appropriately but whenever I search for test-city I just get redirected to *mydomainhere.com*/_sft_city=test-city
(and there are no results there… It is an error page)How to get the form to link to mydomain.com/RELEVANT_TAXONOMY/RELEVANT_PHRASE ?
I’ve read through the documentation but it didn’t help.
Also, I can give you the site’s details and admin panel access in private message.Thanks
Ross Moderator(Private) October 22, 2015 at 11:34 am #27946Hi there
Unfortunately S&F Pro doesn’t use the taxonomy archive URLs for searching.
Please check the demos:
http://demo.designsandcode.com/sfpro-movie-reviews/
http://demo.designsandcode.com/sfpro-woo-mystile/shop/These also behave in the same way.
S&F Pro is for creating a search page – so whenever a user interacts with the form, they will either be redireced to the search page or it will happen with Ajax.
That being said, you do clearly have an issue above with the
?not appearing in the URL which is causing you an error on the search results.Could you ensure you are using the latest 2.0.2 version?
Also, what is your display method for your results? (can be found in the “display results” tab)
Check here for the correct way to setup your method:
http://www.designsandcode.com/documentation/search-filter-pro/search-results/#Display_Results_Method
Thanks
Anonymous(Private) October 22, 2015 at 2:43 pm #27972Thanks you. All is good now.
One thing though, I want to change the _sft_ prefix to something like location_
I did a search and replace on everywhere inside the plugin where there was _sft_ to location_
But it completely destroyed the search (0 results every time).
So I un-installed, re-installed the plugin and rebuilt a search form.
But still no go. As long as the prefix is not _sft_ the search is ruined.
I couldn’t figure out why.
These are the lines where I replaced _sft_ :
class-search-filter-post-cache.php –
20.725 array_push($filters, “_sft_”.$field[‘taxonomy_name’]);
38.682 $insert_arr[“_sft_”.$taxonomy_slug] = array();
38.823 array_push($insert_arr[“_sft_”.$taxonomy_slug], $term->term_id);class-search-filter-config.php
4.356 array_push($filters, “_sft_”.$field[‘taxonomy_name’]);
4.721 array_push($fields, “_sft_”.$tax_field);class-search-filter-display-shortcode.php
342 define(‘SF_TAX_PRE’, ‘_sft_’);Can you help me?
Anonymous(Private) October 22, 2015 at 2:48 pm #27974This worked: http://mydomain.com/?_sft_city=test-city
After the change, this did not work: http://mydomain.com/?location_city=test-city
Ross Moderator(Private) October 22, 2015 at 2:48 pm #27975This is not supported I’m afraid – I’m not sure what the issue is, but I was planning on making this customisable at some stage / set by the user – however I haven’t got round to this yet.
Thanks
-
AuthorPosts