我使用從我的軟件包中調用的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