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
/// <summary> | |
/// Extends the LayoutService context with localized errors. | |
/// </summary> | |
public class ErrorsLayoutServiceContextProcessor : JssGetLayoutServiceContextProcessor | |
{ | |
public ErrorsLayoutServiceContextProcessor(IConfigurationResolver configurationResolver) : base(configurationResolver) | |
{ | |
} | |
protected override void DoProcess(GetLayoutServiceContextArgs args, AppConfiguration application) |
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 Microsoft.Extensions.DependencyInjection; | |
using Newtonsoft.Json.Linq; | |
using Sitecore.JavaScriptServices.GraphQL.LayoutService; | |
using Sitecore.LayoutService.Configuration; | |
using Sitecore.LayoutService.ItemRendering.ContentsResolvers; | |
using Sitecore.Mvc.Presentation; | |
using System; | |
namespace Custom.Foundation.Content.JavascriptServices.RenderingContentsResolvers | |
{ |
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
/// <summary> | |
/// Builds a tree-like structure of datasource item's descendants | |
/// </summary> | |
/// <seealso cref="Sitecore.LayoutService.ItemRendering.ContentsResolvers.RenderingContentsResolver" /> | |
public class DescendantsRenderingContentsResolver : Sitecore.LayoutService.ItemRendering.ContentsResolvers.RenderingContentsResolver | |
{ | |
protected override JObject ProcessItem(Item item, IRenderingConfiguration renderingConfig) | |
{ | |
var jObject = base.ProcessItem(item, renderingConfig); |
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
/// | |
/// Don't forget following config file patch for Sitecore: | |
/// <configuration> | |
/// <sitecore> | |
/// <events> | |
/// <event name="item:saved"> | |
/// <handler type="YourNameSpace.Sitecore.Events.RichTextEditorSaveEvent, YourNameSpace.Sitecore" method="OnItemSaving"> | |
/// <database>master</database> | |
/// </handler> | |
/// </event> |