1

Is it possible to display all the forms in the Freeform forms field alphabetically?

The default appears to be order by date created, but on a site with over 100 forms it becomes nigh impossible to quickly find a form created several months back. I'm unable to find any documentation on the order of the forms, however.

1 Answer 1

1

Updated: This has been ported over to Craft 3 in Freeform version 3.13.24 2/14/2023

I did see in the updates this was fixed for craft 4.

Freeform Version 4.0.8 November 21, 2022

  • Fixed a bug where the Freeform Form element field type was not sorting form options alphabetically.

I am currently still running Craft 3 So this is my temporary solution to get them to sort alphabetically until I upgrade to craft 4 or they port the fix to craft 3.

By default Freeform Form field type orders the forms in the dropdown by ID. To force the field type to sort the forms Aphabetically by name you will need to edit the vendor files for the plugin on the server since this has no CP feature to change it.

The issue with this method is its always risky updating your vender files and when you install an update to the plugin this will revert back to default and you will need to change it again. Unless of course the update contains the fix for this or you are updating to version 4.0.8 or newer.

  1. Script Location:
    • "{Your app location}\vendor\solspace\craft-freeform\packages\plugin\src\FieldTypes\FormFieldType.php"
  2. Currently change line 52 in FormFieldType.php:
    • $forms = $freeform->forms->getAllForms();
      to
      $forms = $freeform->forms->getAllForms(true);

The true variable is just telling the getAllForms function to return the list alphabetically instead of by ID.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.