using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using System.Collections.Generic; using zero.Commerce.Options; using zero.Core.Options; using zero.Core.Plugins; using zero.Debug.TestData; namespace zero.TestData { public class TestPlugin : IZeroPlugin { public void Configure(IZeroPluginOptions plugin, IZeroOptions zero) { plugin.Name = "Test Plugin"; //ISection spaceSection = zero.Sections.GetAllItems().FirstOrDefault(x => x.Alias == Constants.Sections.Spaces); //zero.Sections.Remove(spaceSection); zero.Spaces.Add(); zero.Spaces.AddList("news", "News", "Articles about the company", "fth-edit"); zero.Spaces.AddSeparator(); zero.Spaces.AddEditor("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"); zero.Pages.Add("news", "News", "News about the company", "fth-file-text"); zero.Pages.Add("content", "Page", "Page consisting of modules", "fth-box", allowAsRoot: true, allowAllChildrenTypes: true); zero.Pages.Add("root", "Homepage", "Entry point for the website", "fth-home", allowAsRoot: true, allowAllChildrenTypes: true, onlyAtRoot: true); zero.Pages.Add("redirect", "Redirect", "Redirect to another page or an external URL", "fth-external-link", allowAsRoot: true, allowedChildrenTypes: new List() { "content", "redirect" }); zero.Modules.Add("richtext", "Richtext", "Simple richtext block editor", "fth-align-left", "Texts"); zero.Modules.Add("headline", "Headline", "Headline with optional subline", "fth-underline", "Texts"); zero.Modules.Add("textWithImage", "Text with image", "Short textblock with image", "fth-layers", "Texts", new List() { "root" }); zero.Modules.Add("gallery", "Gallery", "Image gallery grid", "fth-image", "Media"); zero.Modules.Add("download", "Downloads", "List containing downloads", "fth-download", "Misc"); zero.Modules.Add("offset", "Offset", "Offset between two modules", "fth-code", "Misc"); zero.Modules.Add("nested", "Nested", "Add nested modules", "fth-layers", "Misc"); } public void ConfigureServices(IServiceCollection services, IConfiguration configuration) { services.Configure(opts => { opts.Documents.Add(); }); //services.Replace(); services.AddTransient(); } } }