Skip to content

Instantly share code, notes, and snippets.

Avatar

Mark Cassidy cassidydotdk

  • Cassidy Consult
  • St. Gallen, Switzerland
View GitHub Profile
@cassidydotdk
cassidydotdk / RenderItem.cs
Created Aug 11, 2016
Quickly render a Sitecore Controller Rendering, using given Item as Datasource
View RenderItem.cs
public virtual HtmlString RenderItem(Item item, string controller, string action)
{
Assert.ArgumentNotNull(item, "item");
Assert.ArgumentNotNullOrEmpty(controller, "controller");
Assert.ArgumentNotNullOrEmpty(action, "action");
var r = new Rendering();
r.DataSource = item.Paths.FullPath;
using (RenderingContext.EnterContext(r))
{
View PerformanceMeasurementProcessorBegin.cs
using System.Diagnostics;
using System.Web;
using Sitecore.Mvc.Pipelines.Response.RenderRendering;
namespace Website.Pipelines.RenderRendering
{
public class PerformanceMeasurementProcessorBegin : RenderRenderingProcessor
{
public override void Process(RenderRenderingArgs args)
{
@cassidydotdk
cassidydotdk / SetupIoc.config
Created May 18, 2016
Setup Castle Windsor for Sitecore 8.1
View SetupIoc.config
<?xml version="1.0"?>
<configuration>
<sitecore>
<pipelines>
<initialize>
<processor type="Website.SetupIoc, Website" />
</initialize>
</pipelines>
</sitecore>
</configuration>