Created
September 29, 2022 13:13
-
-
Save trnktms/69017b51e553c8337c4fb287d6a511d7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Newtonsoft.Json.Linq; | |
using Sitecore.Data.Items; | |
using Sitecore.LayoutService.Configuration; | |
using Sitecore.LayoutService.ItemRendering.ContentsResolvers; | |
namespace Foundation.ContentsResolvers | |
{ | |
public interface IDefaultRenderingContentsResolver : IRenderingContentsResolver | |
{ | |
JObject ProcessItem(Item item, IRenderingConfiguration renderingConfig); | |
} | |
/// <summary> | |
/// This implementation is needed to able to use item serialization out of the Content Resolver context | |
/// </summary> | |
public class DefaultRenderingContentsResolver : RenderingContentsResolver, IDefaultRenderingContentsResolver | |
{ | |
public DefaultRenderingContentsResolver() | |
{ | |
this.IncludeServerUrlInMediaUrls = false; | |
} | |
public JObject ProcessItem(Item item, IRenderingConfiguration renderingConfig) | |
{ | |
return base.ProcessItem(item, null, renderingConfig); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment