Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Steve Kallal 9 posts 29 karma points
    Jan 05, 2012 @ 19:17
    Steve Kallal
    0

    Data driven menus

    I've seen a lot of menu examples that are based on the content tree. I have needs for a menu system that is separate from the content tree structure.

    For example, lets say I have a menu of team members in my company. The menu structure would be:

    The Team
    Team Member A
    Team Member B
    Team Member C

    But the structure in the content tree is:

    The Team
    Team Member A
    Team Member B
    Team Member C

    All pages are at the same level in the content tree, but there is a parent child relationship in the menu. The same could be said for breadcrumbs.

    I have considered creating my own custom XML file in App_Data to define the menu structure. It would be better if there was a mechanism in Umbraco to define hierarchical structures. Perhaps a custom data type? I'd like to edit the menu structure within Umbraco itself.

    Obviously the best solution would be to define the menu hierarchy in the content tree. I may not have that option. I certainly don't with some existing company sites.

    I currently I've been hard coding the menu structure in Razor. It is ugly.

     

    Any ideas?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jan 05, 2012 @ 19:26
    Jan Skovgaard
    0

    Hi Steve

    I my world it does not make sense to not create the hierachial structure if you want to display the data in a hierachy?

    However I think you should perhaps consider adding a multiple node tree picker on the "Team site" document type and then pick the nodes you want for your menu. Then you should be able to create it "half-automatically".

    Be aware that you should install uComponents in order to use the MNTP. Maybe you are also able to do the same with just using the ultimate picker that comes out o the box where you can set it up to display the possible nodes as multuple checkbox thingy.

    Hope this helps a bit.

    /Jan

  • Jørgen Bakke Eriksen 44 posts 95 karma points
    Jan 22, 2013 @ 13:03
    Jørgen Bakke Eriksen
    0

    Steve, I suppose you already have solved this somehow since the post is one year old :-)

    I just wanted to inform you that we recently have built a complete site according to the principle of separation between menu structure and content. Using this principle it is easy to re use content, selecting a few-from-many items for image sliders etc. The alternative would be use extra properties on document types, classification according to some taxonomy or other proprietary solutions to "publish" a few-from-many.

    We have created a document type MenuItem which contains a property of type multi node tree picker. We then build the menu structure with MenuItems and map content to the respective MenuItems. The actual content is easily displayed with a minimum of effort if you know a little razor. We use the same principle of mapping content for other containers that are used on the front page like image sliders, profiled references and products (selecting 5 out of 19) etc. No duplication of content, just mapping content to a container.

    There is of course some overhead since you have to create MenuItems, but I guess there should be possible to create MenuItems automatically using plugins and placing them in the menu structure

    You should also see DanH's threads about the same issue: http://our.umbraco.org/forum/templating/templates-and-document-types/15135-Umbraco-backend-structure-best-practices-for-separating-layout-and-content-

    Sadly, there seems to be some performance issues with this approach which I am uncertain if are solved: http://our.umbraco.org/forum/core/general/14617-Umbraco-doesn't-cache-content-from-a-Content-Picker

Please Sign in or register to post replies

Write your reply to:

Draft