Copied to clipboard

Flag this post as spam?

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


  • Danny Blatant 91 posts 358 karma points
    Sep 23, 2014 @ 19:12
    Danny Blatant
    0

    Container DocTypes for other common DocTypes

    Hi there,

    Any advice on what I'm trying to achieve here? I have the following (pseudo) structure :

    We have some standard pages, like Home and About, then we have a number of brands, lastly we have some pages that display these brands and some custom content depending on Brand (This content is via a 3rd party interface, not in the CMS). SO the structure would look like this :

    Home (Standard Page)
    --About (Standard Page)
    -- Brand Information (Brand Page)
    -- Brand Locations (Brand Page)
    -- Brand Stuff (Brand Page)
    -- Brand X (Brand)
    -- Brand Y (Brand)
    -- Brand Z (Brand)
    

    another way to look at it is like this :

    Home (Standard Page)
    -- About (Standard Page)
    -- Brand Information (Brand Page)
    ---- Brand X (Brand)
    ---- Brand Y (Brand)
    ---- Brand Z (Brand)
    -- Brand Locations (Brand Page)
    ---- Brand X (Brand)
    ---- Brand Y (Brand)
    ---- Brand Z (Brand)
    -- Brand Stuff (Brand Page)
    ---- Brand X (Brand)
    ---- Brand Y (Brand)
    ---- Brand Z (Brand)
    

    The issues I have with this are that to maintain a decent structure in the Admin Panels there's alot of duplicate Brands DocTypes. Also I do not want the Brands themselves to be navigatable, they are kind of partial DocTypes that drive the content of the Brand Page's.

    Another thought I had is :

    Home (Standard Page)
    -- About (Standard Page)
    -- Brand X (Brand)
    ---- Brand Information (Brand Page)
    ---- Brand Locations (Brand Page)
    ---- Brand Stuff (Brand Page)
    -- Brand Y (Brand)
    ---- Brand Information (Brand Page)
    ---- Brand Locations (Brand Page)
    ---- Brand Stuff (Brand Page)
    -- Brand Z (Brand)
    ---- Brand Information (Brand Page)
    ---- Brand Locations (Brand Page)
    ---- Brand Stuff (Brand Page)
    

    Here, while structurally it makes more sense again we have duplication, this time on the Brand Page's, not ideal! Also I need the Brand Pages to be canatonical without the brand name, i.e. www.site.com/information will display a single page with a brand selector, the content is then dependant on the selector. so this structure is probably not what we need.

    Lastly I thought, "How about a container DocType?". This way I can do a structure like this :

    Home (Standard Page)
    -- About (Standard Page)
    -- Brand Information (Brand Page)
    -- Brand Locations (Brand Page)
    -- Brand Stuff (Brand Page)
    -- Container (Container) <== the theoretical container :D
    ---- Brand X (Brand)
    ---- Brand Y (Brand)
    ---- Brand Z (Brand)
    

    This works for me, no duplication, each Brand Page can load the children of the container and do its thing. However The container and the Brands need to be totally un-navigatble, that is hidden form Nav menus and not browsable at all by URL. Can anyone expand on this? It's not as simple (and clunky) as a Template for the Container with a 404 redirect in it, is it?

    Hopefully someone can make a suggestion, even if its a routing affair. Last thing is that the Brands themselves must be retirevable via code so the Brand Page DocType can iterate them.

    Any ideas or opinions?

    Danny "Blatant"

  • Danny Blatant 91 posts 358 karma points
    Sep 24, 2014 @ 19:45
    Danny Blatant
    100

    Well holy cow, the desired solution (the last one) actually turned out to be really easy!

    When you define your Container DocType, just be sure you do not create a matching template, once created if you never select a Template in the default Properties the Umbraco Router will direct requests to the 404 page, you can testt this with the Link to document link in general properties.

    Likewise if you do not wish for your child items to be displayed, you can unsleect their 'Template' as well and they will be pushed to 404 land.

    The child nodes are still there, you can iterate them as normal. If you want to hide the containers from the Navigation use the umbracoNaviHide propertie, or if you're the super attentive type, overload the DocType model and declare the umbracoNaviHide property there as read only.

    Kind Regards,

    Danny "Blatant"

Please Sign in or register to post replies

Write your reply to:

Draft