Copied to clipboard

Flag this post as spam?

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


  • Ryios 122 posts 263 karma points
    Jul 14, 2015 @ 17:36
    Ryios
    0

    Hijack Backoffice Controllers? Angular

    I have built a plugin that has Content Types it relies on to function.

    When the plugin dll is present it uses ContentType events to prevent users from deleting the Content Types or making breaking changes to them.

    I would like to take it a step farther and give my Content Types custom gui's tailored to my plugin so that when they click on one of the Content Types in the back office for my plugin instead of the default umbraco gui to add properties etc... They get my gui.

    Is this possible?

    I Imagine I could dive into the angular layer and figure a way to hook the angular controller and redirect it to a new angular controller loaded in the js part of my package manifest, but I'm wondering if something to do this is already built in.

  • Warren Buckley 2106 posts 4836 karma points MVP 7x admin c-trib
    Jul 14, 2015 @ 17:52
  • Ryios 122 posts 263 karma points
    Jul 14, 2015 @ 18:44
    Ryios
    0

    Thanks,

    However I already know about those, I've created many of them.

    What I want to do is render my content type with a different Api Tree Controller.

    I want to remove the Create/Copy/Export/Delete options from the menu, and if you click on my content type I want the entire Content Type Editor view to be my custom view so instead of seeing Info/Structure/Generic properties/Tabs... You see my GUI which would probably just say

    "This content type is locked by XYZ Plugin, uninstall the plugin to regain control of this content type".

  • Ryios 122 posts 263 karma points
    Jul 14, 2015 @ 18:46
    Ryios
    0

    I know that the backoffice is all angular, as such I know that I could technically load custom javascript to replace the Umbraco Tree Controller that is responsible for the DocumentTypes section, then I could pass the calls to the original controller if I'm not interested in them.

    However that's really hacky so I was wondering if there is a legit way to do this.

  • Warren Buckley 2106 posts 4836 karma points MVP 7x admin c-trib
    Jul 15, 2015 @ 01:06
    Warren Buckley
    0

    Ok I understand your requirements a lot better now Ryan.

    I have a few ideas but it's middle of night feeding the little one. Get back to you soon with an idea.

  • Warren Buckley 2106 posts 4836 karma points MVP 7x admin c-trib
    Jul 15, 2015 @ 09:26
    Warren Buckley
    0

    OK finally back at my desk at the office.

    Firstly I would ask, why are you doing this?

    Why break a convention of the Umbraco backoffice that people expect to work?

    Myself as an Umbraco developer was to install your packaging that you seem to be creating, I would be a bit frustrated I could not edit or modify these document types with either new properties that I may want. Surely it is down to me as a user/developer.

    However if you still want to modify this expected behaviour, then I would think about use tree events on the Document Types tree.

    That could allow you to remove the right click menu options for your particular nodes that match your document type alias & I believe from memory you could then change what happens when the node is clicked. As this section of Umbraco is legacy and uses a legacy iFrame wrapper.

    Take a look at this for documentation https://our.umbraco.org/documentation/extending-umbraco/section-trees/trees-v7

    If tree events are not the solution for you, then perhaps you could listen to an event fired in JavaScript such as $locationChangeStart event fired by $location service as part of AngularJS or some other event that Umbraco uses.

  • Ryios 122 posts 263 karma points
    Jul 15, 2015 @ 14:39
    Ryios
    0

    I'm not really sure what I'm going to do with it yet, I just wanted to know if the tree could be customized.

    Depending on how much I can inject into the experience I might end up improving it, as opposed to removing function.

Please Sign in or register to post replies

Write your reply to:

Draft