2020-05-12 15:22:39 +02:00
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
using System.Collections.Generic;
|
2020-05-12 13:42:01 +02:00
|
|
|
using zero.Core.Entities;
|
|
|
|
|
using zero.Core.Plugins;
|
|
|
|
|
|
|
|
|
|
namespace zero.TestData
|
|
|
|
|
{
|
2020-05-12 15:22:39 +02:00
|
|
|
public class Test2Plugin : IZeroPlugin
|
2020-05-12 13:42:01 +02:00
|
|
|
{
|
2020-05-12 15:22:39 +02:00
|
|
|
public void Configure(IServiceCollection services, IZeroPluginBuilder builder)
|
2020-05-12 13:42:01 +02:00
|
|
|
{
|
2020-05-12 15:22:39 +02:00
|
|
|
builder.PageTypes.Add(new PageType<NewsPage>()
|
2020-05-12 13:42:01 +02:00
|
|
|
{
|
|
|
|
|
Alias = "news",
|
|
|
|
|
Name = "News",
|
|
|
|
|
Description = "News about the company",
|
|
|
|
|
Icon = "fth-book"
|
|
|
|
|
});
|
|
|
|
|
|
2020-05-12 15:22:39 +02:00
|
|
|
builder.PageTypes.Add(new PageType<ContentPage>()
|
2020-05-12 13:42:01 +02:00
|
|
|
{
|
|
|
|
|
Alias = "content",
|
|
|
|
|
Name = "Page",
|
|
|
|
|
Description = "Page consisting of modules",
|
|
|
|
|
AllowAsRoot = true,
|
|
|
|
|
AllowAllChildrenTypes = true
|
|
|
|
|
});
|
|
|
|
|
|
2020-05-12 15:22:39 +02:00
|
|
|
builder.PageTypes.Add(new PageType<RedirectPage>()
|
2020-05-12 13:42:01 +02:00
|
|
|
{
|
|
|
|
|
Alias = "redirect",
|
|
|
|
|
Name = "Redirect",
|
|
|
|
|
Description = "Redirect to another page or an external URL",
|
|
|
|
|
AllowedChildrenTypes = new List<string>() { "content", "redirect" }
|
|
|
|
|
});
|
|
|
|
|
|
2020-05-12 15:22:39 +02:00
|
|
|
builder.Renderers.Add<OptionsPagePartial, OptionsPagePartialRenderer>();
|
|
|
|
|
builder.Renderers.Add<MetaPagePartial, MetaPagePartialRenderer>();
|
|
|
|
|
builder.Renderers.Add<NewsPage, NewsPageRenderer>();
|
|
|
|
|
builder.Renderers.Add<RedirectPage, RedirectPageRenderer>();
|
|
|
|
|
builder.Renderers.Add<ContentPage, ContentPageRenderer>();
|
2020-05-12 13:42:01 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|