Field type "menu item"?

More
3 years 5 months 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
3 years 5 months 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
3 years 5 months ago - 3 years 5 months 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: 3 years 5 months ago by kath.

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

More
3 years 5 months 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
1 year 7 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.277 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