扩展 umbraco 仪表板 [英] Extending the umbraco dashboard

查看:36
本文介绍了扩展 umbraco 仪表板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将我自己的部分添加到 umbraco 仪表板,以便我可以将我自己的管理部分集成到现有的登录/管理结构中.如果不编辑和重新编译 umbraco 源代码本身,这可能吗?是否推荐?如果是这样,有人有资源可以开始这样做吗?

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 recompiling the umbraco source itself? Is it recommended? If so, does anyone have resources to get started doing this?

推荐答案

是的,这是可能的.

后端可以在仪表板、部分和内容树方面进行扩展.

The backend can be extended both in terms of the dashoard, sections and content trees.

有一个配置文件可用于定义新的仪表板部分.可以在以下文件夹中找到配置文件:/config/dashboard.config

There is a config file you can use to define new dashboard sections. The config file can be found in the following folder: /config/dashboard.config

通常,dashboard.config 文件有一些示例 XML,说明它需要如何构建,看起来像这样(我对其进行了一些扩展以显示更多功能).

Normally the dashboard.config file has some example XML of how it needs to be structured which looks something like this (I've extended it a bit to show more of the features).

<dashBoard>
    <section>
        <areas>
            <area>default</area>
            <area>content</area>
            <area>member</area>
        </areas>

        <tab caption="Last Edits">
            <control>/usercontrols/dashboard/latestEdits.ascx</control>
        </tab>
        <tab caption="Latest Items">
            <control>/usercontrols/dashboard/newestItems.ascx</control>
        </tab>
        <tab caption="Create blog post">
            <control>/usercontrols/umbracoBlog/dashboardBlogPostCreate.ascx</control>
        </tab>
    </section>
    <section>
        <areas>
            <area>media</area>
        </areas>

        <tab caption="Last Edits">
            <control>/usercontrols/dashboard/latestEdits.ascx</control>
        </tab>
    </section>
</dashBoard>

部分节点允许您为不同的管理部分设置不同的选项卡组.在上面的示例中,标签最新编辑、最新项目和创建博客文章将应用于默认、成员和内容部分.默认是用户在选择一个部分之前登录后端时看到的第一件事.

The section node allows you to set up different tab groups for different admin sections. In the example above the tabs Latest Edits, Latest Items and Create blog post will be applied to the default, member and content sections. Defaut is the first thing the user sees when logging into the back end before selecting a section.

要控制在不同部分中显示的内容,您可以设置一个新的部分节点并定义它适用于哪个区域以及要显示的选项卡.在上面的示例中,第二部分仅适用于媒体部分.

To control what is seen in the different sections, you set up a new section node and define which area it applies to and the tab to show. In the example above the second section applies only to the media section.

选项卡中显示的是普通的 .NET 用户控件.这可以与 Umbraco 完全分开,也可以包含 umbraco 特定代码,具体取决于您是集成遗留应用程序还是只是扩展 umbraco.

What is displayed in the tab is a normal .NET user control. This can be totally separate from Umbraco or can contain umbraco specific code, depending on wether you are integrating a legacy application or simply extending umbraco.

如果您想创建一个新部分(出现在 umbraco 后端左下角的图标之一),那么您需要弄得更脏一些.

If you wish to create a new section (one of the icons that appears in the bottom left corner of the umbraco backend) then you will need to get your hands a little dirtier.

要添加一个部分,您需要添加几个数据库条目.首先,您需要在 umbracoApp 表中定义应用程序.

To add a section you need to add a couple of database entries. First you need to define the app in the umbracoApp table.

然后为管理员用户 (0) 向 umbracoUsers2App 添加一个条目.

Then add an entry to umbracoUsers2App for the admin user (0).

然后您需要定义一个新的内容树并创建支持的用户控件.

You'll then need to define a new content tree and create the supporting user controls.

这里有更多关于设置的信息:http://www.geckonewmedia.com/blog/2009/8/3/how-to-create-a-custom-section-in-umbraco-4

There is more information about setting this up here: http://www.geckonewmedia.com/blog/2009/8/3/how-to-create-a-custom-section-in-umbraco-4

第一种方法(仅定义一些新选项卡)比添加新部分要容易得多,因此我建议您从该方法开始.然后,当您感觉更舒服时,您可以直接进入并创建全新的部分和内容树!

The first approach (just defining some new tabs) is considerably easier than adding a new section, so I'd recommend you start with that. Then when you are more comfortable you can dive right in and create whole new sections and content trees!

这篇关于扩展 umbraco 仪表板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆