Copied to clipboard

Flag this post as spam?

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


  • Chris Roberts 3 posts 83 karma points
    Jun 12, 2017 @ 11:05
    Chris Roberts
    0

    Angular Routing / Views in Custom Section

    Hi,

    I'm creating a custom backoffice section for Umbraco. I'm trying to do something slightly 'non-standard' with the tree and I'd like some advice on the best way to achieve it...

    I appreciate that under normal circumstances, each item in the tree would represent an item in a data store somewhere. In this instance, clicking an entry in the list fires the 'edit' route, with the id of the record, and all is well.

    In my case, I'd like the items in the tree to represent different 'pages' within my application, such as "Reports", "Settings", etc.

    With the default routing, each of these entries is being redirected to the same 'edit.html' with the id set to "Reports" or "Settings" (for example).

    What's the best way to change the behaviour such that clicking on an item in the tree ends up with the user hitting a "reports.html" or "settings.html" view instead?

    Thanks in advance,

    Chris

  • Alex Skrypnyk 6163 posts 24143 karma points MVP 8x admin c-trib
    Aug 05, 2017 @ 11:07
    Alex Skrypnyk
    0

    Hi Chris

    It depends on markup if markup of the views are the same - it's ok to have id and one view, but if you have pretty different html - please use separate views. It's just my opinion.

    Thanks,

    Alex

  • David Brendel 792 posts 2970 karma points MVP 3x c-trib
    Aug 07, 2017 @ 07:10
    David Brendel
    0

    Hi Chris,

    have a look at all parameters of the CreateTreeNode method. The last one is the path of the view you want to use with the node.

    You can set a custom one for your different node types in your tree.

    Regards David

Please Sign in or register to post replies

Write your reply to:

Draft