Copied to clipboard

Flag this post as spam?

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


  • Louis Ferreira 69 posts 265 karma points
    Aug 06, 2018 @ 10:53
    Louis Ferreira
    0

    How to add my own 'umbraco.extended.controllers.js' file to backoffice with ClientDependancy

    Hello,

    I am extending the functionality of the built-in grid layout control and so have added new views etc. All is working great, with the exeption that the only way I can get my controller to work in angular is to add it to the 'umbraco.controllers.js' file... which I don't want to do (for obvious reasons). I also don't really want to create a App_Plugin directory for this as it will be too close to something else that is already in there.

    So my question is: I would like to move my angular controller code into a file called /umbraco/js/umbraco.extended.controllers.js and have the back office load this just like does for the normal umbraco.controllers.js file (I think it uses client dependancy library for this). I have seen that there is a client dep config file that mentions something along the lines that it will bundle all js & css files, but I'm not seeing my js file loaded in the back office.

    Any ideas?

  • Laurent Lequenne 122 posts 247 karma points
    Aug 06, 2018 @ 11:00
    Laurent Lequenne
    0

    You should create a plugin in your app_plugins directory. and use a manifest file, to load your custom scripts/css/views on the client.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Aug 06, 2018 @ 11:34
    Jan Skovgaard
    100

    Hi Louis

    You will need to create a custom folder in the /App_Plugins/ directory in order to achieve this - You can read more about this in Dave's article here https://skrift.io/articles/archive/changing-backoffice-functionality-without-changing-core-code/

    Matt also writes about it here https://24days.in/umbraco-cms/2015/umbraco-7-back-office-tweaks/

    The key is to use interception, which basically mean you don't touch the core files but intercept the api calls and then serve your own views. I think this is the approach you need to take since it will allow you to overwrite existing functionality without overwriting the core files on disk.

    I hope this helps a bit.

    /Jan

  • Louis Ferreira 69 posts 265 karma points
    Aug 07, 2018 @ 05:29
    Louis Ferreira
    0

    Thanks guys,

    It seems the best way to do this is to create a plugin in the App_Plugins folder which I was hoping to avoid.

Please Sign in or register to post replies

Write your reply to:

Draft