Skip Navigation

[Resolved] data parent only pulls some options into dropdown

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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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 5 replies, has 2 voices.

Last updated by Christian Cox 5 years, 11 months ago.

Assisted by: Christian Cox.

Author
Posts
#1166440

I am trying to: Have ALL parent options appear in dropdown without having to start typing part of the word

Link to a page where the issue can be seen: hidden link (district field - top left)

I expected to see: ALL parents appear there

Instead, I got: Some (random?) selection of options

#1167197

Hi, there are two options for this dropdown:
1. The typeahead / autosuggest option you described
2. A standard select field

With the standard select field, all published parent posts will be displayed as options. However, there is no typeahead field so searching can be a bit cumbersome. With the typeahead field you get the autosuggest option, but you cannot see all parent posts at first. You can switch between the two options by adding or removing use_select2="never" from the cred_field shortcode attributes:

Typeahead field: [cred_field field="@book-chapter.parent" class="form-control" output="bootstrap" select_text="--- not set ---"]

Standard select field: [cred_field field="@book-chapter.parent" class="form-control" output="bootstrap" select_text="--- not set ---" use_select2="never"]

There is also a minimum number of results required to display the typeahead style input field. If there are fewer than I think 16 options, a standard input field is shown.

#1167903

Thanks, Christian. That worked to pull all the parents.

One additional question:
when I use the new code:
field='@district_demographic-data.parent'
I can't get the sort or to be alpha by name despite adding order='title' ordering='asc' it seems to disregard those settings.
Only if I use the old
field='_wpcf_belongs_district_id' will it link in ascending alpha order.
What am I missing?

#1168859

It turns out that order and ordering are only supported when use_select2 is set to "always". It's mentioned the documentation here:
https://toolset.com/documentation/user-guides/cred-shortcodes/#cred_field

#1169005

Oh. That seems pretty limiting. As it is I have to choose between having a full drop-down list or proper ordering? Or use the old code. Is there a plan to extend ordering to other use_select2 settings?

#1169031

As it is I have to choose between having a full drop-down list or proper ordering? Or use the old code.
Correct, or write custom code that accomplishes exactly what you want. I don't know of a plan to extend ordering into the basic relationship select field. If you'd like to see that added to the software, I encourage you to submit a feature request here: https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/
Our management will consider the request and decide if it's something we can implement.