Comments: The same might be true with post reference fields. You should check those too.
Further question: can I add an "add another" button to make it more fluid to create more than 1 relationship? Currently, I can submit as many relationships as I want, but it's not obvious to the user that that's what's happening. It would be nice if I could "repeat the field."
Thanks.
Hi Timothy,
I've performed a few tests with post reference fields and noticed that for [cred_field] shortcode, the sorting and ordering direction parameters work as expected.
You'll just have to make sure that you're specifically adding the "order" parameter with possible options as "title", "ID" or "date".
For ordering direction, you can use the "ordering" parameter with "desc" or "asc" as a possible option.
The automatically generated shortcode for post reference fields, in some cases, misses these parameters. But I'm going to pass on these new findings with the concerned team, to have it further tested.
Appreciate you brought this forward and let me know if the sorting works for your post reference fields, using these parameters.
regards,
Waqar
Hi,
I have two problems. 1 I can't get the post reference to sort A-Z under Toolset. orderby="title" order="ASC". (I have tried combinations.)
Having more than one post reference field makes both of them have the same contents despite both pointing to separate CPTs.
--Sam
Hi Sam,
Thanks for writing back.
In my tests, I wasn't able to reproduce any of these issues.
The order attributes worked as expected when "order" and "ordering" attributes were used in the "cred_field" shortcode:
( ref: https://toolset.com/documentation/user-guides/cred-shortcodes/#cred_field )
Examples:
[cred_field field='field-slug' force_type='field' class='form-control' output='bootstrap' select_text='--- not set ---' order='title' ordering='desc']
[cred_field field='field-slug' force_type='field' class='form-control' output='bootstrap' select_text='--- not set ---' order='title' ordering='asc']
Likewise, when two different post reference fields (connected to different CPTs) were used in the form, they correctly brought a list from only the relevant CPT.
I'll recommend making sure all plugins are up-to-date and testing with non-toolset plugins disabled.
If the issue still persists, you're welcome to share temporary admin login details, for a website where this issue can be seen.
(your next reply will be private)
Important note: Please make a complete backup copy of the website, before sharing the access details.
regards,
Waqar