Skip Navigation

[Resolved] Cannot change the Year selection as empty on first time view

This support ticket is created 5 years, 11 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 8 replies, has 3 voices.

Last updated by kelvinL-2 5 years, 10 months ago.

Assisted by: Christian Cox.

Author
Posts
#1221679
Screenshot 2019-03-27 at 9.19.52 PM.png
Screenshot 2019-03-27 at 7.27.11 PM.png

Dear Sir/Madam,

I have a View with search section, I want to default all fields as an empty entry.

Below is the code

	<div class="col-sm-4 col-xs-12">
		[wpml-string context="wpv-views"]汽車品牌:[/wpml-string] [wpv-control auto_fill_default=" " field="brand" url_param="brand" type="select" auto_fill="wpcf-brand" auto_fill_sort="asc"]
	</div>
	<div class="col-sm-4 col-xs-12">
		[wpml-string context="wpv-views"]車類型:[/wpml-string] [wpv-control auto_fill_default=" " field="car-type" url_param="car-type" type="select" auto_fill="wpcf-car-type" auto_fill_sort="asc"]
	</div>
	<div class="col-sm-4 col-xs-12">
		[wpml-string context="wpv-views"]車型號[/wpml-string] [wpv-control-postmeta field="wpcf-car-model" type="textfield" url_param="car-model"]
	</div>
</div>
<div class="row home-car-search">
	<div class="col-sm-4 col-xs-12">

		[wpml-string context="wpv-views"]車齡:[/wpml-string] [wpv-control-postmeta field="wpcf-year" order="desc" url_param="wpv-wpcf-year"]
	</div>
	<div class="col-sm-4 col-xs-12">
		[wpml-string context="wpv-views"]傳動:[/wpml-string] [wpv-control auto_fill_default=" " field="mode" url_param="mode" type="select" auto_fill="wpcf-mode" auto_fill_sort="asc"]
	</div>

I don't know why only the Year must fill with the value. How can I make this like others?

What is the difference between wpv-control and wpv-control-postmeta, all these I select from control.

Best regards,

Kelvin.

#1221776

Hi, it depends on the options you select for each custom field filter. You can try adding empty space in the default_label attribute like this:

[wpv-control-postmeta field="wpcf-year" order="desc" url_param="wpv-wpcf-year" default_label=" "]
#1221862

Dear Christian Cox,

I solved with below code

[wpv-control field="wpcf-year" url_param="wpv-wpcf-year" auto_fill = "wpcf-year" auto_fill_default=" " auto_fill_sort="desc"]

What is the difference between wpv-control-postmeta and wpv-control ?

#1221907

Normally a wpv-control-postmeta shortcode will be generated by the system for any custom field filter. When was this View originally created? If you delete this filter shortcode, delete the Query Filter, and recreate it, is a wpv-control-postmeta shortcode generated?

#1221914

Dear Christian Cox,

I can't remember when was this View originally created, must over than 3 years.

Best regards,

Kelvin

#1222720

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Kelvin,

If you were to delete the filter and re-add it as Christian mentioned would it still result in the same issue ? Christian is currently on vacation today so i'm having a look at his queue for him.

Thanks,
Shane

#1223305

Dear Shane,

I solved the issue but I asked whatthe difference between wpv-control-postmeta and wpv-control is?

I can do in either wpv-control-postmeta and wpv-control?

Best regards,

Kelvin.

#1223514

The wpv-control shortcode is an older syntax but it's still supported. The newer syntax, wpv-control-postmeta, was introduced in a more recent version of Views. This is the syntax generated by the current version of Views for custom field filters. The two shortcodes support slightly different attributes, as you can see in the docs here:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-control
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-control-postmeta

#1223952

My issue is resolved now. Thank you!