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.
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.
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?
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.
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
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.
is working on a reply...