Extending the umbraco dashboard

前端 未结 2 727
暖寄归人
暖寄归人 2021-01-30 09:25

I\'d like to add my own section to the umbraco dashboard so that I can integrate my own admin piece to the existing login/admin structure. Is this possible without editing and

2条回答
  •  南方客
    南方客 (楼主)
    2021-01-30 10:14

    Wow! 7 years old post still top on google search.

    So lets update the answer:

    Here you can find the documentation for Extending Dashboard: Dashboards

    Dashboard

    As with the other .config files in the /config directory the Dashboard.config file lets you customize a portion of the Umbraco experience. In this case the Dashboard.config file controls what shows up in the Dashboard section of the UI when a section of the site loads. The Dashboard is the area on the right side of the UI where most of the data entry and functional interaction takes place.

    By default, Umbraco shows a blank Dashboard when a new section loads and only shows a form when you take action within the section (i.e. when you click on a node in the Content section, the Dashboard shows the form to update that node's data). But what if you wanted to present your UI users with some options even before they click on a node? Well that is what the Dashboard.config allows you to do.

    Layout

    Like the other .config files Dashboard.config is a simple XML file with a fairly straight-forward layout as seen below.

     
     
       
    [area name] ... [path] ...
    ...

    Section (different from a Umbraco UI Section) Delimits dashboard information to apply to one or more sections. The Dashboard.config may include multiple sections.

    Areas

    Defines to which sections of the Umbraco UI to apply the subset of dashboard information. area - Always lowercase!

    The name* of the Umbraco UI Section where you want your user control to be displayed (e.g. content, media, developer, settings, members or a custom section name). You can add your controls to more than one section by adding multiple nodes.

    The area with the name 'default' is the first dashboard shown when a user login, no matter which sections the user have access to!

    A little gotcha, make sure you include the name of your app in lowercase!

    Tab

    Defines a page tab that you would like your user control to be added to. The attribute 'caption' defines the text displayed on the tab. There can be multiple tabs for each Dashboard "page" control

    Defines the path to the user control you would like to be displayed on a tab.

    The element makes it possible to set permissions on sections, tabs and controls and you can either grant or deny certain usertypes access.

    It works by adding an node under either a

    , or node. As children of you can either add

    which grants permissions to those types of users (AND automatically deny access to those who're not there!)

    which grants permissions to those users who got access to specific sections. This can be useful for more granular permissions

    which denies permissions to those types of users (AND automatically grants everyone else)

    No matter the settings the root user (id:0) can see everything, so don't panic if you set deny permissions for administrators and still are able to see everything ;-)

    Example on permissions:

    
        
            writer
            editor
            content
        
        /usercontrols/dashboard/latestEdits.ascx
    
    

    Customizing

    In order to customize the dashboard in Umbraco, one needs to do a couple of things. Create one or more UserControls

    The Dashboard loads one or more UserControls and displays them on a series of tabs. So in order to customize the control, one needs to first create the UserControls that are to be displayed on the page. If these are for your own personal use you can just place the UserControls in a location on your site that can be accessed by Umbraco. It is recommended that you place them in the /usercontrol directory, preferably in your own subfolder. If you are creating a package for others to use, you should include the usercontrols in the package for install with the rest of the package contents. Update the Dashboard.config

    Once you have created the UserControls that you want to have loaded when a section loads, you must then update the Dashboard.config to tell Umbraco to load your UserControls when a user enters a new section. Again if you are doing this for yourself all you need to do is edit the Dashboard.config on your site to add the controls. However, if you are adding a section to go with a package, you will want to include a Package Action to update the Dashboard.config during install. Click here for more information on Package Actions. Sample

    Below is an example of a valid Dashboard.config:

     
    
        
    content editor /usercontrols/dashboard/latestEdits.ascx /usercontrols/dashboard/newestItems.ascx /usercontrols/umbracoBlog/dashboardBlogPostCreate.ascx

    What this does is every time a user clicks on the Content section of the Umbraco UI (the sections are in the lower left of the screen) it loads a page with three tabs called "Last Edits", "Latest Items" and "Create blog post". For each tab a UserControl is loaded to provide the functionality that the developer created for those tabs. The UI finds the UserControls via the paths provided.

提交回复
热议问题