Try our conversational search powered by Generative AI!

Class CanonicalLinkExtensions

Extension methods for rendering Canonical link tags for content.

Inheritance
System.Object
CanonicalLinkExtensions
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Web.Mvc.Html
Assembly: EPiServer.Cms.AspNet.dll
Version: 11.20.7
Syntax
public static class CanonicalLinkExtensions

Methods

Renders a canonical link element for the current context.

Declaration
public static MvcHtmlString CanonicalLink(this HtmlHelper html)
Parameters
Type Name Description
System.Web.Mvc.HtmlHelper html

The HTML.

Returns
Type Description
System.Web.Mvc.MvcHtmlString

A canonical link element with the canonical url for the current context.

Renders a canonical link element for the provided parameters.

Declaration
public static MvcHtmlString CanonicalLink(this HtmlHelper html, ContentReference contentLink, string language, string action)
Parameters
Type Name Description
System.Web.Mvc.HtmlHelper html

The HTML.

ContentReference contentLink

The content link of the content. If null the current content will be used.

System.String language

The content language. If null the current content language or preferred language will be used.

System.String action

The controller action that should be appended to the url. If null the current action will be used. Use an empty string to remove the current action.

Returns
Type Description
System.Web.Mvc.MvcHtmlString

A canonical link element with the canonical url for the provided parameters.