Replace editor view of another module (Advanced menu)

Topics: Customizing Orchard, Writing modules
Jun 5, 2012 at 2:19 PM

Hi guys, I am thinking about customizing Advanced menu module for better usability by replacing textbox for "location" (where you are supposed to write things like 2.3.4) with some jquery tree picker where you can select "parent" menu item from tree.

What is the most clean (recommended) way to replace editor view (Menu.RelationPart.cshtml) with the one in my module? (to be clear: i do not want to duplicate&hack entire Advanced menu module, just "extending" it with my own)

 

Coordinator
Jun 5, 2012 at 8:53 PM

The recommended way is to wait for Orchard 1.5 or to use the current 1.x branch.

You're welcome ;)

Jun 6, 2012 at 7:35 AM

Sebastien, I have asked because I am curious about how to do it and want to learn something.. Your answer is anything but helpful, well, maybe you just dont care about people willing to develop on your platform, i dont know...

Your way then: when do you expect 1.5. will be released ?

Developer
Jun 6, 2012 at 8:24 AM

I think what Sebastien is alluding to is that the 1.5 branch has got a complete rewrite of the inbuilt Menu, I don't think he was being unhelpful, just not clear maybe.

The Advanced menu module is written by a guy named Piotr.... I will ping him on Skype as he will know any extension points around this area of code.

Developer
Jun 6, 2012 at 9:39 AM

I think overriding the editor shape template (i.e. list Advanced Menu as a dependency in your module, copy Menu.RelationPart.cshtml to your module's Views folder, modify it as you like) is the way to go, if there are no other extensions points of course (maybe Piotr divided the template into smaller ones for more precise overriding and is Display()-ing them in the main template)

Jun 6, 2012 at 11:17 AM
Edited Jun 6, 2012 at 11:21 AM

@sebastienros:

iam looking at the new menu from 1.x right now and i think it has even less usable administration interface at this moment than Piotrs advanced menu. Hope it gets better until 1.5 is released ;)

1. The drag & drop functionality is nice, but unusable for larger than small navigation structures. Adding a dropdown with rendered menu inside or a popup treeview to select parent node would help. I understand that you just picked up existing code and merged it into your new navigation module, right?

2. All content items are created at the top level. A content part with ajax treemenupicker like rouen_sk want to create, would be much, much better. If we want to make professional level sites (and we sure want), with lots of edits and new articles, the administration backend has to be top usable with a great ergonomy.

3. Are you planning a widget that could act as submenu? The desired feature is "show items belonging to parent of currently selected menu item to a preconfigured depth". I do not see how to accomplish this with the current menu widget from 1.x where i have to put in a constant for the "root".

4. I hope the menu and menu items are fully localizable and that optional links between menu items can be created.

5. the query menu item is a great idea, but i found a bug. Added Pages with title test, test1, test2, test22, test222. If you click on test222 then test22, test2 and test gets selected :-)

Jun 6, 2012 at 11:50 AM
Edited Jun 6, 2012 at 11:51 AM

@agono thanx for summig up, these are all must have things in CMS navigation

Just to illustrate your point 1 (and also point of my original question above), see this

http://s7.postimage.org/au2lvt5ij/orchard_menu_contentcreating.png  (this is "photoshoped" img, not actual screenshot, i have not this done yet)

This tree can be ajax-enabled (expand only nodes you need) so it would handle large structures with no problem; you can pick where do you want do create menu item for edited content item, so you dont have to go to the navigation administration and drag every created item to the right place (virtually impossible in large navigation)

@Piedone yes, i want to do just that, i dont understand how - how exactly i tell that i want my new Menu.RelationPart.cshtml from my module be used to render this shape, and not the Menu.RelationPart.cshtml from original module?

Developer
Jun 6, 2012 at 11:56 AM

You don't have to tell. If you just place the template into your module's folder and you declare Advanced Menu as a dependency, the system will figure out which one takes higher priority. You could also do this from a theme: themes always take the highest priority.

Coordinator
Jun 6, 2012 at 5:08 PM

@rouen_sk: "maybe you just dont care about people willing to develop on your platform"

I just want to prevent you from coding anything that you will throw out in a month or so. But I can't prevent you from doing so, feel free to implement a better  menu module. Or maybe you could also join our weekly meetings and give us some feedback and participate in the design of those features, like we have been doing for the last 3 weeks about the navigation module.

@agono:

1. This matter has been discussed last week during the committee meeting, you really should join and make your voice heard. The decision was that such HUGE menus are generally huge because they embed lots of contents. Those contents in the current menu system will obviously come dynamically injected, and is not rendered in the tree to keep it light. There will be an option to do that later but nobody want to see those big menus while working on it.

I don't see what code was merged actually. If you are talking about the Menu Part editor, we have also decided during the last meeting not to include it by default, but replace it with a new Navigation Part just showing if the current content item is on specific menus. If you don't like it, you can also remove the part. This will be demonstrated at today's meeting.

2. See end of previous answer

3. It's already implemented, it was demonstrated 2 weeks ago, and there is also a Breadcrumb widget.

4. Now they are localizable. That's why we also can create multiple menus. What are "optional links between menu items" ?

5. Can you file a bug please with this simple repro ?

As a reminder, weekly meetings every Wednesday at 12PM PST. Please introduce yourself if you join today.

Coordinator
Jun 6, 2012 at 5:14 PM

Forgot the link:

https://join.microsoft.com/meet/sebros/TWFQ3LYH

Jun 7, 2012 at 8:34 PM

thank you for invitation, i missed it unfortunately:(

1. I was not writing about HUGE menus but anything beyond tiny menus ;-) Try to administer a menu with 30-50 items with the drag-drop adminstration UI. A large menu is typically a eshop menu with hundreds of menuitems.

3. thats nice. i really did not find out how to set it up this way. i give it another try.

5. bug filed.