Files
mixtape/zero.Debug/TestData/TestPlugin.cs
T

52 lines
2.7 KiB
C#
Raw Normal View History

using Microsoft.Extensions.DependencyInjection;
2020-05-13 14:06:11 +02:00
using System.Collections.Generic;
2020-07-06 15:58:31 +02:00
using System.Linq;
2020-08-28 01:10:55 +02:00
using zero.Commerce.Entities;
2020-07-06 15:58:31 +02:00
using zero.Core;
using zero.Core.Entities;
2020-08-28 01:10:55 +02:00
using zero.Core.Extensions;
2020-05-13 14:06:11 +02:00
using zero.Core.Options;
using zero.Core.Plugins;
2020-08-28 01:10:55 +02:00
using zero.Debug.Models;
2020-05-13 14:06:11 +02:00
using zero.Debug.TestData;
namespace zero.TestData
{
2020-05-12 15:22:39 +02:00
public class TestPlugin : IZeroPlugin
{
2020-05-19 10:57:35 +02:00
public void Configure(IZeroPluginOptions plugin, IZeroOptions zero)
{
2020-05-19 10:57:35 +02:00
plugin.Name = "Test Plugin";
2020-08-20 15:11:41 +02:00
//ISection spaceSection = zero.Sections.GetAllItems().FirstOrDefault(x => x.Alias == Constants.Sections.Spaces);
//zero.Sections.Remove(spaceSection);
2020-07-06 15:58:31 +02:00
zero.Spaces.AddList<TeamMember>("team", "Team", "Our team members", "fth-users");
zero.Spaces.AddList<News>("news", "News", "Articles about the company", "fth-edit");
zero.Spaces.AddSeparator();
zero.Spaces.AddEditor<SocialContent>("social", "Social", "Links to social media", "fth-twitter");
zero.Features.Add(TestFeatures.Wishlist, "Wishlist", "Frontend wishlist for logged-in users");
zero.Features.Add(TestFeatures.SocialShopping, "Social shopping", "Integrate products into social media portals");
2020-05-13 14:06:11 +02:00
2020-05-19 15:53:01 +02:00
zero.Pages.Add<NewsPage>("news", "News", "News about the company", "fth-file-text");
zero.Pages.Add<ContentPage>("content", "Page", "Page consisting of modules", "fth-box", allowAsRoot: true, allowAllChildrenTypes: true);
zero.Pages.Add<ContentPage>("root", "Homepage", "Entry point for the website", "fth-home", allowAsRoot: true, allowAllChildrenTypes: true, onlyAtRoot: true);
2020-05-19 15:53:01 +02:00
zero.Pages.Add<RedirectPage>("redirect", "Redirect", "Redirect to another page or an external URL", "fth-external-link", allowAsRoot: true, allowedChildrenTypes: new List<string>() { "content", "redirect" });
2020-08-19 11:22:45 +02:00
zero.Modules.Add<RichtextModule>("richtext", "Richtext", "Simple richtext block editor", "fth-align-left", "Texts");
zero.Modules.Add<HeadlineModule>("headline", "Headline", "Headline with optional subline", "fth-underline", "Texts");
zero.Modules.Add<TextWithImageModule>("textWithImage", "Text with image", "Short textblock with image", "fth-layers", "Texts", new List<string>() { "root" });
zero.Modules.Add<GalleryModule>("gallery", "Gallery", "Image gallery grid", "fth-image", "Media");
2020-08-20 14:35:08 +02:00
zero.Modules.Add<DownloadModule>("download", "Downloads", "List containing downloads", "fth-download", "Misc");
zero.Modules.Add<OffsetModule>("offset", "Offset", "Offset between two modules", "fth-code", "Misc");
}
2020-05-18 15:55:43 +02:00
public void ConfigureServices(IServiceCollection services)
{
2020-08-28 01:10:55 +02:00
//services.Replace<IChannel, SalesChannel>();
2020-05-18 15:55:43 +02:00
services.AddTransient<ITestService, TestService>();
}
}
}