/// <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); }
/// <summary> /// Append meta description element to the <![CDATA[<head>]]> /// </summary> /// <param name="html">HTML helper</param> /// <param name="part">Meta description part</param> public static void AppendMetaDescriptionParts(this IHtmlHelper html, string part) { IPageHeadBuilder pageHeadBuilder = ServiceProviderFactory.ServiceProvider.GetService <IPageHeadBuilder>(); pageHeadBuilder.AppendMetaDescriptionParts(part); }
/// <summary> /// Append meta description element to the <![CDATA[<head>]]> /// </summary> /// <param name="html">HTML helper</param> /// <param name="part">Meta description part</param> /// <param name="pageHeadBuilder"></param> public static void AppendMetaDescriptionParts(this HtmlHelper html, string part, IPageHeadBuilder pageHeadBuilder = null) { if (pageHeadBuilder == null) pageHeadBuilder = EngineContext.Current.Resolve<IPageHeadBuilder>(); pageHeadBuilder.AppendMetaDescriptionParts(part); }