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.
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=" "]
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 ?
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?
Dear Christian Cox,
I can't remember when was this View originally created, must over than 3 years.
Best regards,
Kelvin
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
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.
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
My issue is resolved now. Thank you!