Copied to clipboard

Flag this post as spam?

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


  • Ayo Adesina 445 posts 1059 karma points
    Sep 05, 2017 @ 16:49
    Ayo Adesina
    0

    Custom Menu for Custom Tree - Create View showing as dialog. Why?

    I have got a custom tree in a custom section of umbraco I have created the menu for the node and specified the view I want to dispaly.

    This is working and Umbraco is finding the correct view - however it is showing as a 'slide out' dialog, how do I tell umbraco/angular to display the view in the main body of the back office?

    This is how I am creating the menu Item:

    MenuItem mi = new MenuItem("views/brand/create", "Create");
                    mi.AdditionalData.Add("opCoId", id.Split('-')[1]);
                    menu.Items.Add(mi);
    

    This is what is getting displayed in Umbraco: enter image description here

  • Ayo Adesina 445 posts 1059 karma points
    Sep 06, 2017 @ 07:35
    Ayo Adesina
    0

    really stuck on this... anyone?

  • Kevin Jump 2342 posts 14889 karma points MVP 8x c-trib
    Sep 06, 2017 @ 07:54
    Kevin Jump
    0

    Hi,

    you need to set the menu item's NavigateToRoute setting

    something like:

    myItem.NavigateToRoute("/view/route/-1");
    
  • Ayo Adesina 445 posts 1059 karma points
    Sep 06, 2017 @ 09:50
    Ayo Adesina
    0

    I tried this with no success:

                MenuItem mi = new MenuItem("views/campaign/create", "New Campaign");
                mi.NavigateToRoute("views/campaign/create");
                mi.AdditionalData.Add("campaignId", id.Split('-')[1]);
                menu.Items.Add(mi);
    
                menu.Items.Add<ActionRefresh>("Reload Nodes");
                //menu.Items.Add<ActionNew>("Create");
    
                return menu;
    

    If I remove the NavigateToRoute it works with a slide out, by adding NavigateToRoute it I get:

    404:  views/campaign/create.html
    

    I just want the view to appare in the main back office area.

  • Kevin Jump 2342 posts 14889 karma points MVP 8x c-trib
    Sep 06, 2017 @ 10:14
    Kevin Jump
    0

    hi

    It does depend on where the view is (so that will be looking in umbraco\views\campain\create?)

    but i think you need to append the id to the navigate to route setting for it to work..

    so maybe "views/campain/create/" + id.Split('-')[1] ?

Please Sign in or register to post replies

Write your reply to:

Draft