Copied to clipboard

Flag this post as spam?

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


  • Jørgen Bakke Eriksen 44 posts 95 karma points
    Jan 30, 2013 @ 08:08
    Jørgen Bakke Eriksen
    0

    Create/map to menuitem on content creation - separation between content and structure

    First question on Our, so be gentle :-)

    We have recently built a site using the principle of separating content from structure. We map content using the multinode picker to nodes of type MenuItem which we use solely for building menu-structure. I thought this was an excellent idea until I read some posts about the missing caching of content from the multinode tree picker and that this has some performance issues.

    I would still wan't to go with the separation of content and structure since I think there are a lot of advantages to this approach, the obvious beeing reuse of content, but also easily setting up containers to pick a-few-from-many etc, using different templates for same content in different parts of a site etc. The site we built doesn't seem to suffer from any performance issues (yet).

    However, there is some overhead in creating and mapping content. We have to go through a series of steps:

    • create content
    • create menuitem
    • map content to menuitem using MNTP
    The ideal situation would be to give the user two possibilities when creating new content:
    1. Map to existing menuitem
    2. Create a new menuitem (much like how the Digibiz Advanced Media Picker works)
    If one could automatically create a menuitem and do the mapping in background when creating content, the user experience for both administrators and editors would be enhanced a lot. I have investigated different approaches for the issue of mapping content to menuitems like:
    • using the MNTP "the other way around", that is select menuitem from the create content dialog.
    • Wire up the MNTP to a relation type
    I think both of these approaches will work. The problem is the finding a solution that would give us the functionality to create a menuitem and to do the mapping in the background when creating content. I know about the ContentService and API, but we haven't had the time to investigate if and how this can help us.
    Any pointers on specific api-functions/events, or comments on strategy or even comments on the concept of separating content from structure would be very much appreciated. 
  • Charles Afford 1163 posts 1709 karma points
    Feb 11, 2013 @ 22:27
    Charles Afford
    0

    Hi, what exaclty are you trying to do here?  I am a bit confused.  What is the end result you want to end up with?  Could you give me an idea of the content structure you have and the document types/ templates.  Are you using xslt or MVC?  Thanks  Charlie :) 

  • Jørgen Bakke Eriksen 44 posts 95 karma points
    Feb 12, 2013 @ 18:40
    Jørgen Bakke Eriksen
    0

    Thanks for the replies Charles. I have added a picture below to try to illustrate one simple use case of the sepation between menu and content. If the image is too small I will try to upload it again or make it available on another URL. We are using razor to build the site but will look into MVC shortly, so if this is easily done with MVC we will cetainly use that.

    Explanation: 

    We build the backend by separing structure from content. The folders is divided into two parts:

    1. The Content folders (1) - holding all the "atomic" content, that is, services, employees, references, normal pages and so on. We have a document type for each and everyone of these content types
    2. The Structure folders (2 and 3) - holding menu like the main menu, 2. navigation, but also containers (explained further below). Here we use a document type called menuItem which has only a few properties, the most important one: a multi node tree picker (MNTP).

    The menu structure/main navigation/main menu and other containers are built using menuItems like shown in the image. The MNTP allows us to map content from the content section (1) to a menuItem in the structure section (2 and 3).

     

    Example 1: selecting a-few-from-many

    In the image below there is an example where we have mapped 2 of our 7 references to the frontpage_references container. This is a great way to pick "a-few-from-many" for f.ex a widget of profiled references to be shown on the frontpage. If we hadn't separated content from structure we would have to solve this is some other way which IMHO isn't by far as user friendly, flexible or oriented at resuse of content:

    • add some category or property to the reference document type to flag content to be shown on frontpage
    • create another folder in the content structure and duplicate the references to be shown on the frontpage

    With the separation this can easily be solved by creating a macro which gets the mapped references, sets up a image slider and shows the mapped references. The number of references can easily be increased/decreased, we can easily substitute references. And all this is done in a very user friendly manner IMHO.

    Example 2: Mapping single content to menuitem

    We also use the concept of separating structure and content for normal main menu items. In the image below I show an example of how we have organized documents of type Services. The document are of course stored in a content folder (1). The main menu is rendered based on menuItems (2). To show some actual content when we click an item in the main menu, we have to map a content item (4) to the menu item as shown in the image below. I know this represents some overhead when there is a one to one mapping between menuItem and content. But the concept of mapping content is general and flexible and we have so many more reasons for doing this that we think the overhead is tolerable J

    But this also illustrates the drawback at the time being. In order to show content you have to:

    1. create some content, f.ex a document of type Service.
    2. Create a menuItem
    3. Map content to menuItem

     

    If the Multi Node Tree Picker would allow us to create or select content, we could actually do step 1 and 2 in one operation.

     

    Hopes this helps to clarify what we wan't to achieve.

     

    Regards

  • Jørgen Bakke Eriksen 44 posts 95 karma points
    Feb 12, 2013 @ 18:44
    Jørgen Bakke Eriksen
    0

    Charles, small update to the post above. Another strategy would of course to have a property on all the document types for content (Service, Employee etc) where one would select the parent menuItem, in other words, where in the menu structure to place the new content and automatically create a menuItem for this content and create the map in code.

    But then we would need to hook into the save routine of content. Maybe that is a better strategy...

  • Charles Afford 1163 posts 1709 karma points
    Feb 12, 2013 @ 21:54
    Charles Afford
    0

    Hi, Jorgen,

    thanks for those screen shots i sort of see what you have done now i think.

    So as far as i gather from you have created a section for your content and a section for your menu and then you are mapping your content to your menu?

    If this is the case, you want to reproduce the structure of your content tree in your menu structure.  That is too say you should have a content section and then using XSLT or RAZOR(Mvc) render your folder structure by looking at that tree and getting the required names.

    So i would only have 

    CONTENT

    and lose

    STRUCTURES

    As you are finding you are going to run into problems that will only get exasabated as your content tree grows.  

    If you do not want content to be displayed in the content tree you can always add a Bool property or dictonary item to the root folder such as: ShowInMenu [true false] and render the menu structure based on wether that property is true or false.

    Hope this makes sense.

    Let me know if this was any help or if i have got what you are doing completly wrong.

    Charlie :)

  • Jørgen Bakke Eriksen 44 posts 95 karma points
    Feb 14, 2013 @ 15:33
    Jørgen Bakke Eriksen
    0

    Charles, I really appreciate your replies on this subject :-)

    You have understood the part about the content and menu sections and the mapping of content to the menu. This is a normal concept in high stake solutions (and other), and a very intuitive approach to reuse of content imho and I see a lot of advantages with this approach. Other concepts like using categories would be needed in order to reuse content without duplication

    I know that one can hide nodes from navigation in umbraco using the navihide but I don't like the approach umbraco has to content organization which is mixing structure and content. If you actually allow end users access to the backend they ARE going to fu#& up sooner or later :-) I wan't to build a more solid back end which allows users to create content without messing with the structure.

    I'm not sure about what kind of problems you think of with this approach? And isn't your proposal of using loose structures a halfway solution to what we are trying to achieve.

    DanH has an old post about the exact same concept (http://our.umbraco.org/forum/templating/templates-and-document-types/15135-Umbraco-backend-structure-best-practices-for-separating-layout-and-content-), but gave up, but this was due to performance issues. We haven't seen anything to those yet so we are still investigating the possibility of doing this.

Please Sign in or register to post replies

Write your reply to:

Draft