Field type "menu item"?

More
4 years 1 month ago #79493 by kath
Field type "menu item"? was created by kath
Hi there,

how can I create a field, so that the user can select a menu item to be stored/rendered in his content item?
I am aware of the field typ "weblink", but I'm looking for something like JCE's button "menu" that offers a GUI to select an existing menu item.

Thanks!
B

Please Log in or Create an account to join the conversation.

More
4 years 1 month ago #79497 by micker
Replied by micker on topic Field type "menu item"?
hello you can create a select field with an sql request inside and create a sql to list menu link with value is link and text is name

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

Please Log in or Create an account to join the conversation.

More
4 years 1 month ago - 4 years 1 month ago #79498 by kath
Replied by kath on topic Field type "menu item"?
Thanks, micker! I helped myself out with this sql:

SELECT link as value, title as text FROM #__menu WHERE client_id=0 AND published=1

- client_id stands for frontend.
- link holds the non-SEF url (see JRoute::_() for solution).
- to filter for a menu, add to the WHERE-clause e.g. "AND menutype=mainmenu".
- more columns of interest are alias, type, access, level, browserNav, template_style_id, language, ...

Best regards!

edit:
To build a link-list, use $f->item->fields->elements. It provides and Array like [ StdClass [value] => str non-sef-url, [text] => str label, ...]
Last edit: 4 years 1 month ago by kath.

Please Log in or Create an account to join the conversation.

More
4 years 1 month ago #79501 by micker
Replied by micker on topic Field type "menu item"?
thanks for return

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

Please Log in or Create an account to join the conversation.

More
2 years 3 months ago #82725 by krae
Replied by krae on topic Field type "menu item"?
thanks for this - very useful!

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.439 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline