Copied to clipboard

Flag this post as spam?

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


  • dev-thandabantu 41 posts 321 karma points
    Aug 11, 2022 @ 12:13
    dev-thandabantu
    0

    Point "view" in the package.manifest to a controller

    Hello community,

    I have used a package.manifest to add a custom dashboard to my backoffice following this documentation. I would like to point to a controller from this file. Is this possible? How do I do that?

    I pointed to am .html file without any issues. I have tried replacing the path for the "view" with the path to the controller (as below) and that didn't work. package manifest file

    NB: I want to display content pending approval on my dashboard. If there is a better approach, kindly advise. Thanks!

  • Johannes Lantz 156 posts 840 karma points c-trib
    Aug 11, 2022 @ 16:33
    Johannes Lantz
    100

    Hiya!

    You can't point to a controller. I would point it to the html file. Then add a js file which would then make a call to the controller. Something like this:

    angular.module("umbraco").controller("myCustomDashboard.controller", function ($http) {
           $http.get("/Controllers/Admin/Index").then(function(data){
              //Do stuff
           });
    });
    

    package.manifest:

    {
      "dashboards":[ ],
      "javascript": [
             "path/to/js/file.js"
       ]
    }
    

    Hope that gets you on the right track!

    //Johannes

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies