Copied to clipboard

Flag this post as spam?

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


  • Marthijn Wassink 17 posts 50 karma points
    Jun 09, 2015 @ 17:09
    Marthijn Wassink
    0

    Load node edit view in custom tree

    Hi all,

    I have created a custom tree to organise my content better. What i want now is to load the edit view from a node without redirecting to the content tree. I created the nodes this way:                    

    var node = CreateTreeNode(campaign.Id.ToString(CultureInfo.InvariantCulture),
                           id,
                            queryStrings,
                            campaign.Name,
                            "icon-umb-members",
                            false,
                            String.Format("/content/content/edit/{0}",        campaign.Id.ToString(CultureInfo.InvariantCulture)));

    This "works" but it redirect to the content node. Is there a way that i can render the edit view in my custom tree section?

     

     

  • Marthijn Wassink 17 posts 50 karma points
    Jun 26, 2015 @ 12:54
    Marthijn Wassink
    2

    I found a solution! The first part of the String.Format is the name of your tree. So "/{custom tree name}/content/edit/{0}"

  • Robert Martine-McEvoy 24 posts 109 karma points
    Sep 28, 2015 @ 23:55
    Robert Martine-McEvoy
    0

    Thanks for posting this Marthijn! Helped me out quite a bit, it's much more elegant that redirecting to the Content tree.

    I wanted to clarify for anyone else looking at doing this - it's the section alias that goes in the route, so if the Custom Tree decoration looks like this:

    [Tree("customSection", "customTree", "Custom Section")]
    

    The route ends up being:

    /customSection/content/edit/{0}
    
Please Sign in or register to post replies

Write your reply to:

Draft