Пример #1
0
        public override Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
        {
            if (!string.IsNullOrEmpty(Attribute))
            {
                _pageHeadBuilder.AddTitleParts(Attribute);
            }
            var content = _pageHeadBuilder.GenerateTitle(DefaultTitle);

            output.Content.Append(content);
            return(Task.CompletedTask);
        }
Пример #2
0
        /// <summary>
        /// Add title element to the <![CDATA[<head>]]>
        /// </summary>
        /// <param name="html">HTML helper</param>
        /// <param name="part">Title part</param>
        public static void AddTitleParts(this IHtmlHelper html, string part)
        {
            IPageHeadBuilder pageHeadBuilder = ServiceProviderFactory.ServiceProvider.GetService <IPageHeadBuilder>();

            pageHeadBuilder.AddTitleParts(part);
        }
Пример #3
0
 /// <summary>
 /// Add title element to the <![CDATA[<head>]]>
 /// </summary>
 /// <param name="html">HTML helper</param>
 /// <param name="part">Title part</param>
 /// <param name="pageHeadBuilder"></param>
 public static void AddTitleParts(this HtmlHelper html, string part, IPageHeadBuilder pageHeadBuilder = null)
 {
     if(pageHeadBuilder == null)
         pageHeadBuilder = EngineContext.Current.Resolve<IPageHeadBuilder>();
     pageHeadBuilder.AddTitleParts(part);
 }