Ejemplo n.º 1
0
        public TaxonomyProcessor(TaxonomyPlugin plugin, LayoutPlugin layoutPlugin) : base(plugin)
        {
            if (layoutPlugin == null)
            {
                throw new ArgumentNullException(nameof(layoutPlugin));
            }
            List = new TaxonomyCollection();

            Site.SetValue("taxonomies", List, true);

            layoutPlugin.Processor.RegisterLayoutPathProvider("terms", TermsLayout);
            layoutPlugin.Processor.RegisterLayoutPathProvider("term", TermPagesLayout);
        }
Ejemplo n.º 2
0
        public TaxonomyProcessor(TaxonomyPlugin plugin, LayoutPlugin layoutPlugin) : base(plugin)
        {
            if (layoutPlugin == null)
            {
                throw new ArgumentNullException(nameof(layoutPlugin));
            }
            List = new TaxonomyCollection();

            Site.SetValue("taxonomies", List, true);

            Site.Content.OrderLayoutTypes.Add("term");
            Site.Content.OrderLayoutTypes.Add("terms");

            layoutPlugin.Processor.RegisterLayoutPathProvider("term", TermPagesLayout);
            layoutPlugin.Processor.RegisterLayoutPathProvider("terms", TermsLayout);

            // Add tags and categories as default taxonomies
            List.ScriptObject.Add("tags", "tag");
            List.ScriptObject.Add("categories", "category");
        }