I successfully created a relationship (beta) and a CRED form that can connect a child to a parent. While in the backend the select box for the connection is a nice combobox, in the CRED form it is a simple select which is rather unconvenient since you cannot properly search for posts.
How can I have the same box functionality in the CRED form as in the backend? Since it works there i feel like this might not be too hard. But I have no idea how to accomplish this.
This is the code used for the CRED form relationship field. I did not find any further options.
[cred_field field='@object-review.parent' select_text='--- not set ---' class='form-control' output='bootstrap']
Hi, the CRED parent select combobox feature is set up to be activated when more than a certain number of items is present in the list. How many parent posts exist in your list at the moment? I think a number greater than 15 should trigger the combobox.
Thanks, that worked perfectly. 🙂
Just two minor follow up questions: Currently I see no way to translate the part "Please enter 1 or more characters" since it is not yet included in the messages box of the CRED form as an optin. I tried to change it with a Jquery but I fear it fires too late. This did not work:
jQuery(document).ready(function(){
jQuery('.toolset_select2-results__message').text('ICH BIN EINE NEUER TEXT');
});
Furthermore. I dont want to reveal the whole list too easily. WI want the user to type in at least 4 characters to trigger the search process. Which file sets this so I can adapt it even if I have to hardcode it.
Thanks in advance 🙂
Ok i found the hardcoded text in this file:
/wp-content/plugins/cred-frontend-editor/vendor/toolset/toolset-common/res/lib/select2/select2.js in line 4484
var message = 'Please enter ' + remainingChars + ' or more characters';
I also found the variable minimumInputLength which seems to be crucial for this. It is set in line 3745:
this.minimumInputLength = options.get('minimumInputLength');
When i hardcode this as well it already works:
this.minimumInputLength = 4;
But where can I set it generally since it seems like this value is stored somewhere?
Thanks in advance ?
I use the CRED beta.
Hi, I've split those questions into another ticket since they'll require more than a few sentences to answer.