C# Class Sdl.Web.Mvc.Html.UrlHelperExtensions

Extension methods for the UrlHelper
Mostrar archivo Open project: sdl/dxa-web-application-dotnet

Public Methods

Method Description
NormalizePageUrlPath ( this urlHelper, string urlPath ) : string

Normalizes a URL path for a Page.

The following normalization actions are taken: Ensure the URL path is extensionless. Ensure the URL path for an index page ends with "/index".

ResponsiveImage ( this urlHelper, string sourceImageUrl, double aspect, string widthFactor, int containerSize ) : string

Generates a responsive image URL.

This is a thin wrapper around IMediaHelper.GetResponsiveImageUrl intended to make view code simpler.

VersionedContent ( this helper, string relativePath, string localization = "" ) : string

Gets a versioned URL (including the version number of the HTML design/assets).

Versioned URLs are used to facilitate agressive caching of those assets; see Sdl.Web.Mvc.Statics.StaticContentModule.

Method Details

NormalizePageUrlPath() public static method

Normalizes a URL path for a Page.
The following normalization actions are taken: Ensure the URL path is extensionless. Ensure the URL path for an index page ends with "/index".
public static NormalizePageUrlPath ( this urlHelper, string urlPath ) : string
urlHelper this
urlPath string The input URL path.
return string

ResponsiveImage() public static method

Generates a responsive image URL.
This is a thin wrapper around IMediaHelper.GetResponsiveImageUrl intended to make view code simpler.
public static ResponsiveImage ( this urlHelper, string sourceImageUrl, double aspect, string widthFactor, int containerSize ) : string
urlHelper this
sourceImageUrl string
aspect double
widthFactor string
containerSize int
return string

VersionedContent() public static method

Gets a versioned URL (including the version number of the HTML design/assets).
Versioned URLs are used to facilitate agressive caching of those assets; see Sdl.Web.Mvc.Statics.StaticContentModule.
public static VersionedContent ( this helper, string relativePath, string localization = "" ) : string
helper this The instance on which this extension method operates.
relativePath string The (unversioned) URL path relative to the system folder.
localization string Not used (deprecated).
return string