Skip Navigation

[Resolved] Set filter to a default value

This support ticket is created 7 years, 3 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.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 3 replies, has 2 voices.

Last updated by Beda 7 years, 3 months ago.

Assisted by: Beda.

Author
Posts
#561327

Tell us what you are trying to do? I would like this page to default to only those vacancies which are available : hidden link

Is there any documentation that you are following?
I have looked through but cannot find how to get a page to load with a default value filled in in a select box within a filter

Here is the filter currently set up:

[wpv-filter-start hide="false"]
[wpv-filter-controls]
[wpml-string context="wpv-views"]Hours per week:[/wpml-string] [wpv-control field="hours-per-week" url_param="hours-per-week" type="select" auto_fill="wpcf-hours-per-week" auto_fill_sort="asc" auto_fill_default="All"]
[wpml-string context="wpv-views"]Role Location:[/wpml-string] [wpv-control field="role-location" url_param="role-location" type="select" auto_fill="wpcf-role-location" auto_fill_default="All"]  [wpml-string context="wpv-views"]Vacancies[/wpml-string][wpv-control-postmeta type="select" default_label="Available or not" order="desc" field="wpcf-vacancies" url_param="wpv-wpcf-vacancies"]
<br>
<br>


[/wpv-filter-controls]

[wpv-filter-end]

Thanks

#561480

You cannot default to (default value) those values dynamically.

They either take a "show all" (all values) or a specific, hard coded Label.

It would require you to pass an URL parameter to the View when you load the page.
This can be done easily by linking to the page and passing an URL parameter that matches your Custom Search URL parameter, and there, you pass the value you want.
This will make the View default to that value.

#561551

Thanks. In that case I'd like to set to a hardcoded value as you suggest, how would I do this for the field "wpcf-vacancies" in this example?

Thank yiu

#562245
Bildschirmfoto 2017-08-22 um 15.56.50.png

I apologise that there was a misunderstading.

With Select Fields you can edit the value and lable you use in the Custom Search.
But you cannot alter the default value in the sense that you cannot make it load in the begin automatically.

For this, you need to pass the URL parameter as elaborated.
Otherwise the View wants to (expectedly) load all results.

What I meant is that you can edit the single Values and Labels as I show in the screenshot, but that will not set a new defauld load value.

For that you need to call the View with an Argument in the URL already set.