Exemplo n.º 1
0
 public override Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
 {
     output.TagName = "meta";
     output.Attributes.Add("name", "description");
     output.Attributes.Add("content", _pageHeadBuilder.GenerateMetaDescription());
     return(Task.CompletedTask);
 }
Exemplo n.º 2
0
        /// <summary>
        /// Generate all description parts
        /// </summary>
        /// <param name="html">HTML helper</param>
        /// <param name="part">Meta description part</param>
        /// <returns>Generated string</returns>
        public static IHtmlContent NopMetaDescription(this IHtmlHelper html, string part = "")
        {
            IPageHeadBuilder pageHeadBuilder = ServiceProviderFactory.ServiceProvider.GetService <IPageHeadBuilder>();

            html.AppendMetaDescriptionParts(part);
            return(new HtmlString(html.Encode(pageHeadBuilder.GenerateMetaDescription())));
        }
Exemplo n.º 3
0
 /// <summary>
 /// Generate all description parts
 /// </summary>
 /// <param name="html">HTML helper</param>
 /// <param name="part">Meta description part</param>
 /// <param name="pageHeadBuilder"></param>
 /// <returns>Generated string</returns>
 public static MvcHtmlString NopMetaDescription(this HtmlHelper html, IPageHeadBuilder pageHeadBuilder = null,
     string part = null )
 {
     if (pageHeadBuilder == null)
         pageHeadBuilder = EngineContext.Current.Resolve<IPageHeadBuilder>();
     pageHeadBuilder.AppendMetaDescriptionParts(part);
     string content = html.Encode(pageHeadBuilder.GenerateMetaDescription());
     return MvcHtmlString.Create(content);
 }