Skip to content

Instantly share code, notes, and snippets.

View cassidydotdk's full-sized avatar

Mark Cassidy cassidydotdk

  • Cassidy Consult
  • Kiel, Germany
View GitHub Profile
@cassidydotdk
cassidydotdk / RenderItem.cs
Created August 11, 2016 09:03
Quickly render a Sitecore Controller Rendering, using given Item as Datasource
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))
{
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 01:45
Setup Castle Windsor for Sitecore 8.1
<?xml version="1.0"?>
<configuration>
<sitecore>
<pipelines>
<initialize>
<processor type="Website.SetupIoc, Website" />
</initialize>
</pipelines>
</sitecore>
</configuration>