Skip Navigation

[Closed] How to make a taxonomy term selected by default in filter control while loading

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 9 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Sun Mon Tue Wed Thu Fri Sat
- 8:00 – 17:00 8:00 – 17:00 8:00 – 17:00 8:00 – 17:00 8:00 – 17:00 -
- - - - - - -

Supporter timezone: America/Sao_Paulo (GMT-03:00)

This topic contains 3 replies, has 2 voices.

Last updated by Adriano 9 years, 5 months ago.

Assisted by: Adriano.

Author
Posts
#254381

I am trying to: Filter content by a custom taxonomy , I want to make a term as default value to be selected from the dropdown while loading the page.. how can i do the same

I visited this URL:

I expected to see: While loading the page i need a term to be selected by default and expecting to show its result.. and when we change the dropdown it have filter based on the selection

Instead, I got: All the values in a dropdown are poplulating and the default is select text

#254512

Please have a look here: https://toolset.com/documentation/views-shortcodes/#wpv-control

There is an argument you can use for that, it is auto_fill_default. It is used to set the default value of the control. If the value is not one of the control values, the value will be placed as the first entry – good for ‘All’ or ‘Select any’ defaults.

#254654

Hi Adriano,

I have tried auto_fill_default attribute of wpv-control but it dosen't work for my purpose... i think as you said it can be used to set a default value other than control value as "Select" or some thing as the first entry...

My need is for example i have a taxonomy called year which i was using in cred forms and also in view filters.. lets think the year taxonomy have two entry 2014 and 2013 .. What i need in cred form is i want to make 2013 as selected when form loads.. In case of filter in view i have this taxonomy as dropdown should load 2014 as default ..and the view should display the contents mapped to 2014 only when the page loads..

#254890

You are right, sorry. The auto_fill_default argument doesn't work for Taxonomy, but for custom fields only. There is no way to select a default one in your View.

Actually we can select a taxonomy as default, but the results will not follow this selection in the first page loads. This is because we do not apply any filter according default values in the form filter.

We have some plans to add this in Views, but not so soon. Because it will affect a lot of places, because will be the first time a default value change the first page loads.

In CRED you can also set a item as default using some custom JS code. In both screens (Views and CRED), you have a section to add custom codes (JS and CSS).

The topic ‘[Closed] How to make a taxonomy term selected by default in filter control while loading’ is closed to new replies.