Copied to clipboard

Flag this post as spam?

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


  • kris 13 posts 54 karma points
    Jul 24, 2014 @ 10:45
    kris
    0

    Creating Doctypes in a custom tree - Umbraco 7

    Hi All,

    With relative ease I've created a custom section and tree in Umbraco 7 using the following online resource...

    1. http://www.enkelmedia.se/blogg/2013/11/22/creating-custom-sections-in-umbraco-7-part-1.aspx
    2. http://www.enkelmedia.se/blogg/2013/11/22/custom-sections-in-umbraco-7-%E2%80%93-part-2-the-views.aspx

    The big deal for me now its to mimic the functionality of the main content tree in my custom tree. I would like the nodes to behave in a similar way where the user can define doctypes and do all of the usual functions create, delete, move, sort etc...

    Using the above tutorials I've managed to add 'Actions' to the node menu when you do a right click a node the option to 'create ' is there but its not actually creating a node related to a doctype, saving to the Umbraco database and being given a NodeId... all the usual stuff you'd expect.

    I know this is going to take some work but I just need to know where to being.

    So my main questions are...

    1. How do you define document types for nodes in the custom tree? Where are these manage ie 'Settings'
    2. How do actually get the functions 'Create' 'Delete' etc to actually work? (I'm guessing it''l be some AngularJS magic)

    My code so far is just whats in the above tutorials.

    Any help will be greatly appreciated thanks in advance guys.

    Kris

  • Timothy Lee Russell 20 posts 43 karma points c-trib
    Jan 09, 2015 @ 23:59
    Timothy Lee Russell
    0

    +1

  • James Russell 6 posts 78 karma points
    Aug 20, 2018 @ 11:23
    James Russell
    0

    Did you manage to get anywhere with this? I'm in the same boat.

  • David Brendel 792 posts 2970 karma points MVP 3x c-trib
    Aug 20, 2018 @ 20:03
    David Brendel
    0

    Hi James,

    the topic is pretty old. There are lots of tutorials out for custom sections and trees in the newer versions.

    One hint: you create custom nodes in the trees which are not related to DocumentTypes at all.

    Regards David

  • James Russell 6 posts 78 karma points
    Aug 21, 2018 @ 08:18
    James Russell
    0

    Hi David,

    Thanks for that, I'm aware that the createTreeNode makes nodes in the trees which are not related to DocumentTypes at all. However I was wondering if it was possible to link them with doc types (cant seem to find any documentation or guides on this specifically, so I'm presuming you cannot).

    The alternative option to my problem would replicate the content tree in my custom section then hide all nodes apart from the ones needed - do you think this would be a good idea or not really best practice?

    Thanks for your time, James

  • David Brendel 792 posts 2970 karma points MVP 3x c-trib
    Aug 21, 2018 @ 14:23
    David Brendel
    0

    Hi James,

    why exactly do you want to achieve in your custom section with your nodes.

    Maybe it is easier to add a custom menu item to the nodes in the content tree?

  • James Russell 6 posts 78 karma points
    Aug 21, 2018 @ 14:56
    James Russell
    0

    I'd like to be able to create nodes (of a specific document type) under certain nodes in my custom tree - just like the regular content tree works... But in order to do that it seems easier if they are all document type'd nodes, that way I can just add the child doc type to the Allowed child node types in the permission section of 'Settings'.

    Here is my original post: https://our.umbraco.com/forum/extending-umbraco-and-using-the-api/93188-creating-custom-umbraco-tree-using-document-types

    Louis mentioned using the TreeService which I'm looking into, I'm just slightly confused as to why I cant use the existing create and delete node functionality on my custom tree - I understand how to add custom tree actions but it seems long winded to have to create new ones when Umbraco already has what I need.

    I'm quite new to Umbraco so maybe I'm just not connecting things in my head correctly. Hopefully this all makes sense.

    Regards, James

  • David Brendel 792 posts 2970 karma points MVP 3x c-trib
    Aug 21, 2018 @ 15:57
    David Brendel
    0

    Hi James,

    if they are actually nodes that sit below other nodes in the content tree then yes normally you do that with setting allowed children and create them as document types. Wouldn't bother with creating a custom section for that.

    Custom sections are for custom data not to handle stuff from the content section.

Please Sign in or register to post replies

Write your reply to:

Draft