0

I am building an admin side form and placed a Menuitem form field, that is working just fine.

It is showing all the menu entries as expected, but I need it to list only the ones for "components" (i.e. exclude menu entries of type url, alias, etc.).

The documentation ([https://docs.joomla.org/Menuitem_form_field_type]) refers the "menu_type" attribute, but that is for a different purpose - it's for "menu type", not "menu entry type").

Is there a way to this via the "Menuitem form field type", or must I go around it with the "SQL form field type" querying the #__menu table?

Many thanks.

1 Answer 1

1

You can use disable attribute to disable unwanted menu item types:

<field
    name="myfield"
    type="menuitem"
    disable="url,heading,separator"
/>
1
  • Thanks! The "disable" attribute is not on the documentation - I would never think of it. It's event better than just not having the unwanted types. Commented Nov 23, 2022 at 14:02

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.