Skip Navigation

[Resolved] unable to set search properly fields get disappear

This thread is resolved. Here is a description of the problem and solution.

Problem:
unable to set search properly fields get disappear

Solution:
There is an issue with views version 2.6.3 which is already reported to our Devs.

you can find proposed solution, in this case, with the following reply:
https://toolset.com/forums/topic/unable-to-set-search-properly-fields-get-disappear/page/2/#post-956348

Relevant Documentation:

This support ticket is created 6 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Our next available supporter will start replying to tickets in about 0.30 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 15 replies, has 3 voices.

Last updated by Minesh 6 years, 4 months ago.

Assisted by: Minesh.

Author
Posts
#948898

i am having 2 issues.

1- filter being applied to search query . i dont want it to apply on search query

2- i am trying to make this page
hidden link

as
hidden link

buttons with images

please guide how to achieve these 2 issues
thanks in advance

i would much appreciate if i can be guided how to fetch shortcuts /dynamic data to pass to my html basse controls. in view

#948986

Hello,

Q1) filter being applied to search query . i dont want it to apply on search query

What kind of filters are being applied to search query? please elaborate the question with more details.

I assume we are talking about the view "HomeSearch":
hidden link
Please edit it, click "Screen Options", enable option " Query Filter", then you will be able to see section " Query Filter", there you can change/remove the Views filter as what you want.

Q2) i am trying to make this page ... buttons with images

There isn't such a built-in feature as your screenshot:
hidden link

In my opinion, you can use some custom JS/CSS codes to style the custom search form as your screenshot, for example:
hidden link
hidden link
hidden link

For your reference.

#948997

thank you very much for replying.
Q1 solved thanks

Q2.

I need help to know which file i can modify to add the custom tool like button or any other field or link ?

and also can u please guide how can i fetch current url of the page so that i can append mine in it .
i will be very much thankful

I have tried this short code [wpv-post-url ] but its not much of a help it dont fetch current url.

#949061
css-js.JPG

You don't need to hack the Toolset plugin file, and we don't recommended that.

As I mentioned above, you just need to setup custom JS/CSS codes to customize the button and fields of custom search form, for example:
Edit the view, in section "Search and Pagination"(if you can not see it, you can click "Screen Options", and enable it), click "CSS Editor" and "JS Editor", there you can setup your own custom CSS/JS codes, see screenshot: css-js.JPG

And here is a document about "Adding custom JavaScript to Views"
https://toolset.com/documentation/user-guides/adding-custom-javascript-views/

The shortcode [wpv-post-url] works in the post content, it won't work in custom JS codes, if you are going to get current page URL in your JS codes, please try the solution of other threads, for example:
https://stackoverflow.com/questions/406192/get-current-url-in-javascript

#949083

i tried that method but url changes after search results and its not getting caught timely. i get old url instead of new url.
[wpv-post-url] works but didnt show desired results.

#950047

I assume you are going to retrieve the URL with URL parameters.

If it is, yes you are right, the shortcode [wpv-post-url] can not achieve what you want.
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-post-url
It can only output the URL to the current post.

In your case, it needs custom codes, for example you can create a custom shortcode:
https://developer.wordpress.org/reference/functions/add_shortcode/
In this shortcode retrieve the full URL with URL parameters:
https://stackoverflow.com/questions/6768793/get-the-full-url-in-php

BTW, there is a built-in shortcode [wpv-search-term], it can get the URL parameter value:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-search-term

for example:
[wpv-search-term param="wpv-param1"]

#950280

Is there any change i am given some guide line which file to modify to add more controls to the view
i sure will be able to proceed if i am guided about file. I know it will get over written but that is my issue

its not working for me and its getting very difficult for me to continue using the plugin .

this is how my page loads initially before transforming
can you please help me with thins issue ?

#951125

I assume you are going to change the source codes of Views plugin file, can you confirm it?
If it is, there isn't guild line for it, we don't recommend you to hack the plugin files, that will conduct problem when you upgrade the plugins, your custom codes will be overridden.

As I suggest above, you just need to add custom CSS/JS codes into the view:
https://toolset.com/forums/topic/unable-to-set-search-properly-fields-get-disappear/#post-949061

If you are going to add custom PHP codes, you can also try other plugins, for example:
https://wordpress.org/plugins/code-snippets/
use it you can setup custom PHP codes without touching your theme files or plugin files.

#951263

can the recommended plugin be able to add a new button to your view.?
or can it be able to add an <option ></option> under ur select. ?

I failed to understand why i am being refereed to 3rd party plugin for almost every query. are you trying to tell that this plugin was a bad choice?

you are requested to provide me a solution
thanks in advance,

#952046

Q1) can the recommended plugin be able to add a new button to your view.?
No, it depends on your custom codes, the plugin "code-snippets" can only help you to add custom PHP codes.

Q2) or can it be able to add an <option ></option> under ur select. ?
What kind of select are we talking about? how and where do you want to add an <option ></option>?
If it is a custom select field, you can setup the options manually, see our document:
https://toolset.com/documentation/user-guides/using-custom-fields/

Q3) I failed to understand why i am being refereed to 3rd party plugin for almost every query. are you trying to tell that this plugin was a bad choice?
The plugin is for adding custom PHP codes without touching theme files and plugin files, if you don't need it, you don't need to try it.

Q4) you are requested to provide me a solution
Since you are asking some features, which are not the built-in feature of Toolset plugin:

<em><u>hidden link</u></em>

buttons with images

Then it needs custom codes, according to our support policy, we don't provide custom codes support:
https://toolset.com/toolset-support-policy/

We cannot produce custom code solutions for you. When you need custom coding which extends Toolset functionality, we recommend contacting one of Toolset certified consultants.
https://toolset.com/contractors/

And I have provide you some CSS/JS suggestions here:
https://toolset.com/forums/topic/unable-to-set-search-properly-fields-get-disappear/#post-948986

#952095

Seems like basic feature e.g buttons were invented with first version of html as well as a href tags.

i need filter to work like the following 1
hidden link

if i dont want to select bedroom i can select the very first button and rest of the filter is not disturbed

please guide how to achieve that
thanks

#952251

Please elaborate the question with more details:
if i dont want to select bedroom i can select the very first button and rest of the filter is not disturbed

I assume we are talking about this page in your own website:
hidden link

Which one field (bedroom) is that you don't want to select?
How and where do you want to select the very first button?
How do you want rest of the filter is not disturbed?

Here is a document about Views custom search form:
https://toolset.com/documentation/user-guides/front-page-filters/

There are some AJAX search feature within the search form:
https://toolset.com/documentation/user-guides/front-page-filters/advanced-settings-custom-search/
for example:
Limiting Filter Inputs According to Available Results
and
Live Updates for View Results

For your reference.

#952312

dear luo yang. if ujust look at the url i shared.
and try selecting different options in the filter.
and try un selecting any it works but in the cause to tookset . it snot possible to unselect a specifc filter option

Like i want to search 2 bedrooms and 2 bathrooms
and it didnt showed any results.
now 1 want to change filter to search all properties with 2 bedrooms and 0 bathrooms. this is achievable using the link i shared but not with the filter i created using toolset.

i need ur expertise to guide me how to achieve that scenario

thanks

#952314

just select some filter and after looking at results.
try unselecting a filter eng
2 bed 2 bath
or 2 bed all baths
or 1 bed 2 baths
etc

#953518

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Luo is on Vacation. This is Minesh here and I will take care of this ticket and try to help you further. Hope this is OK.

Well - as I understand as I can see with this link: hidden link
=> You want to add default option "Please Select" with each filter so that you can rule out (uncheck) the current filter which is applied to view but for now you are not able to set the default option.

you can setup a default option but I've tested with my local test site and it looks like that there is a bug when you try to add a filter with default option. I'll report this to our Devs.

In the mean time I've added following code as workaround for filter "HOUSE DESIGNS":

 <input class="js-wpv-filter-trigger" name="wpv-wpcf-stories" value="" id="form-d5b1212fc0e58f1c8414d1038b9113f5-1" checked="checked" type="radio"> 
  <label class="wpcf-form-label wpcf-form-radio-label" for="form-d5b1212fc0e58f1c8414d1038b9113f5-1">ALL</label>  
  

And I can see its working. You should try to add same default option by changing the name and ID of input as required.

However, I would also like to acknowledge what Luo said earlier that to redesign your filers as per your need using CSS/JS is pure custom programming tasks which is beyond the scope of our support policy.