Class SitecoreFieldExtensions

Version: 21.x

Set of extension methods for Sitecore fields.

Inheritance
System.Object
SitecoreFieldExtensions
Namespace: Sitecore.AspNet.RenderingEngine.Extensions
Assembly: Sitecore.AspNet.RenderingEngine.dll
Syntax
RequestResponse
public static class SitecoreFieldExtensions : Object

Methods

Gets modified URL string to Sitecore media item.

Declaration
RequestResponse
public static string GetMediaLink(this ImageField imageField, object imageParams)
Parameters
TypeNameDescription
ImageFieldimageField

The image field.

System.ObjectimageParams

Image parameters, example: new { mw = 100, mh = 50 }. IMPORTANT: All the parameters you pass must be whitelisted for resizing to occur. See /sitecore/config/*.config (search for 'allowedMediaParams').

Returns
TypeDescription
System.String

Media item URL.

Do you have some feedback for us?

If you have suggestions for improving this article,