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 126 posts 425 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 1451 posts 9716 karma points MVP 5x 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

  • 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