2

I added a field type "sql" to show a list of options in the Article Options in Joomla 4. But I need to add a field like this with a search box inside to looking for one of the voices typing part of the options (because the options are many).

So, I need something like this:

enter image description here

I noticed that in Joomla 3 someone used "formbehavior.chosen" to do this, but this function is applied to every list in the Article Options, and I don't want it. I want this behavior, this search box in a list, only for a specific list.

Is there a way in Joomla 4 to do this in a simple way? Can I just set an attribute in the field element of the XML file to do this? Thank you :)

1
  • Welcome Nintendomi. Please take our tour while you wait for feedback/support. Commented Feb 4, 2022 at 11:06

2 Answers 2

1

In J4 you can use joomla.form.field.list-fancy-select layout for list fields. To use in XML form, add layout attribute to the field:

layout="joomla.form.field.list-fancy-select"
1
  • Great, it works perfectly! Thank you very much :)
    – Nintendomi
    Commented Feb 6, 2022 at 13:45
0

If anyone is interested in a more recent method (Joomla 4.3 and upwards):

When you edit the list type custom field (or SQL custom field type), go to the tab "Options" and at the "Form Options", the item "Layout" has an option named "Enhanced select".

This will add a modern search (and match).

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.