Skip Navigation

[Resolved] CRED parent field dropdown shows search box instead of list of post titles

This support ticket is created 6 years 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 6 replies, has 2 voices.

Last updated by raikoK 6 years ago.

Assisted by: Beda.

Author
Posts
#630146
201803301-Toolset-CRED-dropdown-parent-post.png

I am trying to:
- show a list of parent post titles in dropdown field in CRED form
[cred_field field='_wpcf_belongs_potential-st_id' value='' order='title' ordering='asc' no_parent_text='']
CRED version 1.9.5, other toolset plugins updates to lates version, WP also latest version

Link to a page where the issue can be seen:
- screenshot attached

I expected to see:
- list on parent post titles

Instead, I got:
- search box with to search post titles

#630213

If you have more than (xy) posts it will show a select2 searchable list.
If you have less than (xy) posts it'll show a list, not searchable.

(xy) should be 15 posts.
This means, if you have 16 posts in that type it'll not show them as a list but as a selct2 searchable and if you have less than 15, it'll show a "normal" select field.

This is expected.

#630248

Thanks for your reply!

How can I change 15 to some other number, i.e. 150?

#630252

There is no setting for this, I would have pointed this out in case we would offer it.

We use a library called "Select2"
hidden link

You could limit the number of posts output, but that is eventually not what you look for.
See the options in the CRED Form > Add Post Fields > Parents

The reason that this select2 has been added is mainly performance.
Loading 150 posts in a select field are not ideal and neither User-Friendly.
Letting the user type and search + having a fast query is nicer in this case.

I can file a request if you agree?

#630264
201803311-Toolset-CRED-dropdown-parent-post.png

Thanks for your reply!

It's not customer public website. Current site is more for a company internal use.

In the current case it is not a problem to wait some seconds more, if needed, to load dropdown values. To make it faster, dropdowns can be loaded with ajax.

While adding the search box to select field, from the UX perspective, we could expect something like this, please see the attachment.

We take that into account. Probably we stay in CRED 1.9.2 version until that issue will be solved. Because it impacts the UX too much for us, sry. CRED 1.9.2 does not work with latest Types plugins version, but from other side we look forward to get updates.

If there is a limit, then could be nice if the number of values displayed can be changed from CRED field settings.
OR
Could be nice if there can be set up from CRED field settings that is the search box displayed or not in the select dropdown. If set to "no", then it could be normal dropdown.

In addition we are looking forward that displayed values can be filtered by some post fields, to display only relevant posts in the dropdown. (i.e. if it is real estate property dropdown then i would like to see in the house contact CRED form only house type (custom field) of properties, not all types of properties.)

Thank you in advance!

#630269

I filed a request to:
- customize the number of items needed to trigger the select2
- customize the query of posts so to manipulate the values returned there

These are feature requests and cannot be added on the fly, they will require elaborated coding and testing.

You will be informed through our Blog or Changelogs when and if this is added.

Can I help you right now with something else?

#630278

We'll looking forward these updates.
Both are high priority for us. The second one we are waiting for last two years.

Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.