Hello,
Following #134301: Display a view as a menu, I spent some time thinking about the way to build such a module allowing to display items of a view as menu items.
About the UI, there would be a new display type called menu in the view admin panel (at admin/build/views/edit/viewname).
In menu editing page (admin/build/menu-customize/menuname), there would be a new tab allowing to add a "view item".
In this tab, one would choose the view, plus manage options (enable, expand, parent, weight).
Attached is a picture of what this would look like…
So it would not be possible to manually edit the menu created form the view, just to insert it at some point within a meny hierarchy.
First question: does it sound a good way to do so?
Then I tried to understand the way to code this (I must confess this would be my first "real" module):
- create a view plugin following help/views/api-plugins in order to have a new "menu" display.
- then, looking at other module provide additionnal style or display like tagadelic_views or ical_calendar, it looks like I have to extend the views_plugin_display class and then to theme the output.
- then I would have to hook into the menu system to choose where to display the output.
Is it right? Where can I find any additionnal doc about creating a display plugin?
Finally, if anybody is interested to join, it would be so helpfull!
Thank you in advance for your help.
P.S.: I did not post it in the module development forum as it looks like one cannot attach picture there :(
| Comment | File | Size | Author |
|---|---|---|---|
| menu_view.jpg | 96.45 KB | julou |
Comments
Comment #1
cimo commentedI am interested in this module, together with Simple Menu could be a really killer combination for admin interfaces.
Simone
Comment #2
OddSim commentedI'm also interested in this. Is seems like a great way to dynamically update the site's menus.
But maybe this be implemented as a Views display type, rather than choosing a view from the menu administration?
Comment #3
julou commentedUnfortunately, I have really less time than expected to progress on this :(
@ OddSim: sure it would be a display type, and you may be right.
All could be configured from the menu display panel of the view, with only reoredring allowed in menu editing page.
Comment #4
SeanBannister commentedSub
Comment #5
dawehnerJust for information. As far as i know, you cannot create dynamic menu items. You have to store them in menu_links or cache with hook_menu.
Comment #6
vood002 commentedsubscribing
Comment #7
lmshawl commentedI am interested in this functionality but was also thinking it would be a Views display type.
Comment #8
kenorb commented+1
Comment #9
esmerel commentedPreviously referenced issue is now part of its own project. That may be the best approach here.