Copied to clipboard

Flag this post as spam?

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


  • Damien Holley 179 posts 540 karma points
    Oct 17, 2020 @ 23:14
    Damien Holley
    0

    Add dashboard CSS & JS in C#

    Hi, how do we go about adding the css files and angular files into a dashboard section without having to use the package manifests?

    I currently have a dashboard where everything is set via c# so the package manifest is not required.

    But all the tutorials going into this assume you will use the js way of doing things with a manifest file etc.

    Something like below:

    [Weight(40)]
        public class TBCDashboardTicketing : IDashboard
        {
        public string Alias => "tbcDashboardTicketing";
    
        public string[] Sections => new[] {
            "TBC" };
    
        public string View => "/App_Plugins/TBC/BOffice/ticketing.html";
    
        public string css => "/App_Plugins/TBC/BOffice/Styles/style.css";
    
        public IAccessRule[] AccessRules {
            get {
                var rules = new IAccessRule[] {
                    new AccessRule {Type = AccessRuleType.Grant, Value = Umbraco.Core.Constants.Security.AdminGroupAlias } };
    
                return rules;
            }
        }
    
    }
    
  • Marc Goodson 2128 posts 14220 karma points MVP 8x c-trib
    Oct 17, 2020 @ 23:38
    Marc Goodson
    100

    Hi Damien

    You can do this for property editors... But not for dashboards 'yet'

    There is this PR where the subject is being discussed

    https://github.com/umbraco/Umbraco-CMS/issues/7640

    Though that's not very helpful 'for now'... :-(

    Regards

    Marc

Please Sign in or register to post replies

Write your reply to:

Draft