Skip to content

Instantly share code, notes, and snippets.

View anastasiya29's full-sized avatar
:octocat:

Anastasiya Nicole Mitchell anastasiya29

:octocat:
View GitHub Profile
/// <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);
@anastasiya29
anastasiya29 / react-helper.js
Last active December 1, 2017 03:23 — forked from tungd/react-helper.js
React Helper to initialize components from HTML. Facilitates React integration with Sitecore renderings.
/**
* react-helper.js
* Source: https://gist.github.com/anastasiya29/8574b153b956ddb7abc928c8eaf7839a
*
* Helper for Facebook's React UI Library. Adds support for declaring
* component from HTML. Adds support for dependency injection.
*
* Usage:
* 1. Register a component with optional dependencies:
* ReactHelper.register('MyComponent', MyComponent, { depName: depFunc })