The CRED form has been in use for about 4 years but the Chamber administrator experienced this issue for the first time today.
The Company Name field is:
[cred_field field='_wpcf_belongs_member_id' value='']
If you type in the box with your company name, it finds up to 10 matches. My problem is, there are more than 10 companies in the database that use the word "Batesville" (the name of the city). Is there a way to have this field display all matches, or can I change the default to more than 10?
The specific use case is that there is a business whose name IS "Batesville". No second word. And their listing ("Batesville") isn't one of the 10 results. There is literally no way to select their name/post. How might I be able to make it available to be chosen?
Christian, thank you. Unfortunately neither of these works, and now I'm wondering if there's another issue.
I applied max_results='20' and also order='title' and nothing changed.
I am correctly passing through attributes to the shortcode. When I view source on the page I can see the "class", "data-orderby" and "data-order" that I'm putting in the shortcode. But no matter what I put in the shortcode for "order" and "max_results", the output does not change.
I also tried putting in a "placeholder" for testing's sake and that does NOT appear on the form.
One thing I am noticing which may or may not be helpful. You wanted me to declare order='title'. However, if I click "Add Fields" in the Form Editor, select "member Parent" and then choose the radio button for Title for the Order, the shortcode does not show order='title'. It seems like title is the default. Yet the site isn't honoring that, whether by default or when explicitly declared.
If you have an alternative to suggest, please do. Or maybe there's a conflict on my side...if you could help me troubleshoot that, if needed, I'd appreciate it. Thank you!
Okay I see...let's take a closer look. The _wpcf_belongs_{parent-post-type-slug}_id syntax for defining the parent post in a one-to-many (O2M) post relationship is an indication this Form (and this site) was probably created before the new post relationships system was released. The new system no longer relies on custom field values, but implements proprietary database tables specific to relationships features. The fact that this is a legacy post relationship may mean some of the features in this field are unavailable, but I'm not sure offhand. The documentation I have available is not comprehensive enough to give me those details, and I would need to get some feedback from the team to give you the best answer here. Can you tell me more about the site?
- Add your site's debug information as described in our FAQ post here: https://toolset.com/faq/provide-debug-information-faster-support/ This will help me determine which Toolset plugins you have installed and the versions of each plugin, the other 3rd-party plugins on your site, and some relevant system/environment details.
- When logged in to wp-admin as an Administrator, please go to wp-admin > Toolset > Relationships if that main menu link exists, and let me know what you see on that page.
I'll review everything and try to get some feedback about the features available for the select2.js field in legacy post relationship fields
For Relationships, I have not enabled them. The message on the page:
Your site has relationships that use the old storage.
A "post relationship" is the connection between different posts on a website. This particularly includes "custom post types".
There are three possible types of post relationships:
One-to-many
Many-to-many
One-to-one
Using a post relationship makes it easier to build and run advanced sites.
Building a site using related posts allows you to separate information into independent pieces, which can then be combined in multiple ways. This eliminates data duplication, enabling you to edit each piece of information only once and use it in any manner you desire.
This is important for both large and small sites.
Please read our comprehensive guide to learn how to use Toolset to leverage the power behind post relationships.
If you do not need to develop or extend this site with new the relationship functionality, it is perfectly safe to not run the migration.
I won't rule out an issue on my end. This site went through a number of twists and turns while it was under development as the client changed their mind about stuff on numerous occasions. Also it was launched during the period of time when Toolset was actively encouraging usage of Layouts. So I do have some things in place which might not be standard and may be contributing to this issue.
Christian, I thought I'd check in just to see if there was anything useful in my debug information, or if you have any other ideas on how I can accomplish my goal.
I recognize the original issue may be an edge case, where the search term is common and there isn't any other word to make it unique. But I would like to figure out why these shortcode attributes aren't being honored. Thank you for your help.
I created a staging site to work with rather than editing on the live site.
After migrating to the new relationship model, and replacing the original [cred_field] shortcode with a new one that uses the new relationships, I had partial success. But it still should be good enough to accomplish my specific need.
[cred_field field='@member_job.parent' class='form-control' output='bootstrap' select_text='--- not set ---' order='title' ordering='asc']
With this shortcode, I had to explicitly declare order=title and ordering=asc even though I kept those default options when creating the shortcode. When the shortcode was inserted those attributes weren't present since they're the default, but I had to add them in. However, when I did add them in, they did work.
The max_results=20 that Christian suggested earlier still didn't work.
However, as long as I am able to have order=title and ordering=asc applied properly, that solves my specific issue. The member whose full name is one single word, now shows up first in the listing. For all the others beyond the 10th result on that first word, they can continue typing. After typing the first letter of the second word in their name, there should be fewer than 10 matches at that point.
I would like to leave this ticket open temporarily, as I have not yet performed the update on the live website. I will do that over the weekend during a period of lesser traffic, and when the client/administrator is not actively using the site. As soon as the adjustments are made on the live site and they are satisfactory I will then close the ticket.
I just applied the change on the live site and it looks like it's going to work.
One more question that I didn't think to ask before now. Is there a way to require that a Company Name field be selected from the dropdown? If I leave that field blank it doesn't generate "this field is required" like the other fields on the form.