示例#1
0
        public void Initialize()
        {
            if (_templatesConfig.Seo == null || !_templatesConfig.Seo.Enabled)
                return;

            foreach (ContentType contentType in _contentTypeManager.GetContentTypes())
            {
                if (IsPage(contentType))
                {
                    FieldSetAttribute seoTab = new FieldSetAttribute("SEO", SeoTabTitle, 15)
                    {
                        Collapsible = true,
                        Collapsed = true
                    };

                    contentType.Add(seoTab);

                    AddEditableText(contentType, HtmlTitleTitle, SeoUtility.HTML_TITLE, 11, _templatesConfig.Seo.HtmlTitleFormat, "Used in the <title> element on the page", 200, false);
                    AddEditableText(contentType, MetaKeywordsTitle, SeoUtility.META_KEYWORDS, 21, _templatesConfig.Seo.MetaKeywordsFormat, null, 400, false);
                    AddEditableText(contentType, MetaDescriptionTitle, SeoUtility.META_DESCRIPTION, 22, _templatesConfig.Seo.MetaDescriptionFormat, null, 1000, true);
                }
                else if (contentType.IgnoreSEOAssets)
                {
                    FieldSetAttribute seoTab = new FieldSetAttribute("SEO", contentType.IgnoreSEOExplanation, 15)
                    {
                        Collapsible = true,
                        Collapsed = false
                    };

                    contentType.Add(seoTab);

                }

            }
        }
        public void Initialize()
        {
            foreach (ContentType contentType in _contentTypeManager.GetContentTypes())
            {
                if (typeof(ISyndicatable).IsAssignableFrom(contentType.ItemType))
                {
                    FieldSetAttribute seoTab = new FieldSetAttribute("Syndication", "Syndication", 30);
                    contentType.Add(seoTab);

                    CheckBoxEditorAttribute ecb = new CheckBoxEditorAttribute(CheckBoxText, string.Empty, 10)
                    {
                        Name = SyndicatableDetailName,
                        ContainerName = ContainerName,
                        SortOrder = SortOrder,
                        DefaultValue = true
                    };

                    contentType.Add(ecb);
                }
            }
        }