Copied to clipboard

Flag this post as spam?

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


  • Adriano Fabri 469 posts 1633 karma points
    Apr 21, 2016 @ 12:15
    Adriano Fabri
    0

    How can I associate a treeItem to my custom routePath and view?

    Hi to all, I'm realizing a package to test angular. My package create a custom section with a tree. When I click a tree item, the default edit url is:

    http://www.mydomain.it/mySection/mytree/edit/treeItemId.html

    I also created a views folder that contain my custom views and is located here:

    App_plugin/mySection/backoffice/mytree/views/treeItemId.html

    How can I associate a treeItem to my custom routePath and view?

    I tried:

    CreateTreeNode("cleanup", id, queryStrings, "Cleanup", "icon-delete color-red", false)
    

    but it search the view into this folder:

    App_plugin/mySection/backoffice/mytree/edit.html

    I also tried:

    CreateTreeNode("cleanup", id, queryStrings, "Cleanup", "icon-delete color-red", false, FormDataCollectionExtensions.GetValue<string>(queryStrings, "application") + "/" + this.TreeAlias + "/users-cleanup")
    

    but it search the view into this folder:

    Umbraco/Views/mytree/treeItemId.html

    I also tried:

    CreateTreeNode("cleanup", id, queryStrings, "Cleanup", "icon-delete color-red", false, string.Format("mySection/backoffice/myTree/views/treeItemId"))
    

    but it search the view into this folder:

    Umbraco/Views/backoffice/mytree.html

    Can anyone help me?

    Thank you in advance

    Adriano

  • Flavio Spezi 129 posts 315 karma points
    Apr 24, 2016 @ 13:29
    Flavio Spezi
    0

    I think that Umbraco uses a predefined structure of RoutePath:

    {sectionAlias}/{treeAlias}/{method}/{id}

    And this path say to Umbraco to open this Angular template:

    App_Plugins/{sectionAlias}/backoffice/{treeAlias}/{method}.html

    If you want to open a template in other path you will use ng-template Angular directive.
    I have not found another solution.

  • Adriano Fabri 469 posts 1633 karma points
    Apr 26, 2016 @ 09:39
    Adriano Fabri
    0

    Thank you Flavio, I think I'll do it...

    :-)

  • Adriano Fabri 469 posts 1633 karma points
    Apr 26, 2016 @ 13:07
    Adriano Fabri
    0

    OK...it's official...I'm very confuse.

    I'm tried (with no results) all I found on internet.

    I'm tried the ng-template and also the ng-include directives, but I don't see my custom view page.

    OK I'm a newbie on angular...but this is frustrating.

    So...can you help me to do that?

    Thank you in advance

    Adriano

  • Flavio Spezi 129 posts 315 karma points
    Apr 26, 2016 @ 13:42
    Flavio Spezi
    0

    Can you post source HTML code and output HTML code?

  • Adriano Fabri 469 posts 1633 karma points
    Apr 26, 2016 @ 14:34
    Adriano Fabri
    0

    Risolto...ehm...SOLVED!!! :-)

    I put in my edit.html file this directive

    <div ng-include="" src="'/App_Plugins/ADRIANO/backoffice/test/views/' + id + '.html'"></div> 
    

    and it works perfectly!!!

    I don't know if this is the best way to use my custom routhPath, but until I don't understand how to optimize it, I am satisfied. :-)

    Adriano

  • Flavio Spezi 129 posts 315 karma points
    Apr 26, 2016 @ 15:06
    Flavio Spezi
    0

    Grande Adriano! :-D

    Perfect!

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies