Copied to clipboard

Flag this post as spam?

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


  • Gary 8 posts 93 karma points
    Apr 02, 2019 @ 02:30
    Gary
    1

    How to use Angular route in backoffice

    Hi guys, I created a custom dashboard called 'Dealer' to display dealer information.I want to edit them with my own view.My directory structure is:

    App_Plugs|
                      |---dashboard
                      |---dashboard|dealer.html
                      |---Backoffice
                      |---Backoffice|edit.html
    

    I want to click on the link in the Dealer.html page to go to page edit.html. I try

    <a href='/content/#/dealer/edit/1'>Edit</a>
    

    But it don't work, return error :Request error: The URL returned a 404 (not found): views/editor.html.

    What should I do to specify the position of the view?

  • Chris Spanellis 45 posts 191 karma points
    Jan 29, 2021 @ 16:54
    Chris Spanellis
    0

    I am trying to do the same exact thing in v8, and have been struggling for days. Anyone out there have an answer to this?

  • Gary 8 posts 93 karma points
    Feb 01, 2021 @ 12:04
    Gary
    0

    You can try:

    <a class="btn btn-link" href="/umbraco/#/dealer/dealerListAlias/edit/dealer_{{item.Id}}"><localize key="actions_edit"></localize></a>
    

    dealerListAlias is view alias. edit is view name. dealer_111 is route parameter.

  • Chris Spanellis 45 posts 191 karma points
    Feb 01, 2021 @ 12:50
    Chris Spanellis
    0

    I finally figured this out (sort of). I wasn't able to have the directory structure I wanted (which is similar to the one outlined in the post), but I am at least able to go to edit page. I'm not sure if it will satisfy your case unless you have a TreeController (with a Tree attribute and PluginController atrribute with the name of the folder I put my pieces in) in your workflow.

    1. On my TreeController, I set the RoutePath to SectionAlias/TreeAlias/overview for when you click on the node in the tree, which always worked fine. This resulted in loading my overview.html in App_Plugins/PluginControllerAttributeName/backoffice/TreeAlias folder.
    2. From there I was able to navigate to my edit.html if I put it in the same TreeAlias folder that contained my overview.html.

    It's as if the Tree established my backoffice route properly, and only things living under that route can be browsed to. I even tried registering a child node to the tree with a custom RoutePath, but it didn't work either.

    This works fine for me, and I will register other custom routes for other trees, and then follow the same pattern. I hope this helps in some way.

Please Sign in or register to post replies

Write your reply to:

Draft