我使用从我的软件包中调用的sectionservice创建了自己的应用程序/部分。我现在试图在本节中添加一个html/angular仪表板视图,但是我找到的所有教程都是关于编辑dashboard.config并在此处添加指向视图的指针。通过我的软件包更新dashboard.config
由于我的目标是创建一个独立的软件包,我不想直接编辑此文件,但实用的添加了一个仪表板到我的部分。
这可能吗?任何人都可以将我链接到教程或提示我应该使用哪些服务。
我不知道如何适用,这是,但我已要求粘贴我的代码创建的原始部分。
using Umbraco.Core;
using Umbraco.Core.Models;
namespace Labs.App_Plugins.StueyLabs
{
public class StueyLabsSection : ApplicationEventHandler
{
protected const string stueyLabsSectionAlias = "stueyLabs";
protected override void ApplicationStarted(UmbracoApplicationBase umbraco, ApplicationContext context)
{
// Gets a reference to the section (if already added)
Section section = context.Services.SectionService.GetByAlias(stueyLabsSectionAlias);
if (section != null) return;
// Add a new "Stuey" section
context.Services.SectionService.MakeNew("Stuey Labs", stueyLabsSectionAlias, "icon-stuey");
// Grant all existing users access to the new section
context.Services.UserService.AddSectionToAllUsers(stueyLabsSectionAlias);
}
}
}
你能添加一些代码吗? – Akashii
你想要什么样的代码?我的部分?对我而言,这似乎与仪表板视图无关,但我仍然会这样做。 – StueyKent