Umbraco 7: create menu datatype with submenus

南笙酒味 提交于 2019-12-11 14:49:45

问题


How can I create a navigation menu data type with submenu items so that I can create it in the back office with properties like text, href, optional image? Something like dropdown multiple. I've installed Umbraco 7.1.5 with NuGet in VS2013 and using Razor syntax.

EDIT: Is it possible to create an object of type menu and edit it in the back-end's UI, for a non-developer. The user should add as many items or sub items as needed with those properties, with a plus sign. I've found this property editor. Is this possible using this property editor?


回答1:


Create a Partial View (in the back-end under the SETTINGS section). If you create a new partial view, one of the pre-created snippets will be "navigation".

Then use some CSS menu (you e.g. created yourself or found on google), and try to match the navigation HTML to that of the CSS menu.

To include the partial view in the template just use

@Html.Partial("NameOfThePartialWithoutExtention")


来源:https://stackoverflow.com/questions/25445890/umbraco-7-create-menu-datatype-with-submenus

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!