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 : ObjectMethods
GetMediaLink(ImageField, Object)
Gets modified URL string to Sitecore media item.
Declaration
RequestResponse
public static string GetMediaLink(this ImageField imageField, object imageParams)Parameters
| Type | Name | Description |
|---|---|---|
| ImageField | imageField |
The image field. |
| System.Object | imageParams |
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
| Type | Description |
|---|---|
| System.String |
Media item URL. |