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 92 posts 330 karma points
    5 days ago
    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 1283 posts 8694 karma points MVP 5x c-trib
    5 days ago
    Marc Goodson
    0

    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