Skip to content

Instantly share code, notes, and snippets.

View hombreDelPez's full-sized avatar

Manuel Fischer hombreDelPez

  • Zurich
View GitHub Profile
@hombreDelPez
hombreDelPez / ResponseHeaders.config
Last active December 18, 2017 14:52
Setting Response Headers - Config
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<pipelines>
<httpRequestEnd>
<processor type="YourProject.Core.Processors.ResponseHeaders, YourProject.Core"/>
</httpRequestEnd>
</pipelines>
</sitecore>
</configuration>
@hombreDelPez
hombreDelPez / ResponseHeadersContextItem.cs
Last active January 29, 2018 15:52
Setting Response Headers - HttpRequestProcessor - Context Item
using System;
using Sitecore;
using Sitecore.Data;
using Sitecore.Pipelines.HttpRequest;
namespace YourProject.Core.Processors
{
public class ResponseHeaders : HttpRequestProcessor
{
private readonly ID _responseHeadersItem = new ID("{2C9586BD-4384-4DBF-B595-CF914572B9CD}");
@hombreDelPez
hombreDelPez / ResponseHeadersSingleItem.cs
Last active January 29, 2018 15:52
Setting Response Headers - HttpRequestProcessor - Single Item
using System;
using Sitecore;
using Sitecore.Data;
using Sitecore.Pipelines.HttpRequest;
namespace YourProject.Core.Processors
{
public class ResponseHeaders : HttpRequestProcessor
{
private readonly ID _responseHeadersItem = new ID("{2C9586BD-4384-4DBF-B595-CF914572B9CD}");
@hombreDelPez
hombreDelPez / nitronet-config.json
Created July 13, 2017 10:30
NitroNet Example Configuration
{
"viewPaths": [
"frontend/views"
],
"partialPaths": [
"frontend/views/_partials"
],
"componentPaths": [
"frontend/components/atoms",
"frontend/components/molecules",
@hombreDelPez
hombreDelPez / NitroNet.Sitecore-UnityConfig.cs
Created June 8, 2017 14:29
NitroNet.Sitecore installation - UnityConfig.cs
using System;
using Microsoft.Practices.Unity;
using System.Web.Hosting;
using NitroNet.ViewEngine.IO;
using System.Configuration;
using NitroNet.UnityModules;
using NitroNet.Sitecore.UnityModules;
namespace NitroNetSitecoreMVC.App_Start
{
@hombreDelPez
hombreDelPez / NitroNet-UnityConfig.cs
Created June 8, 2017 14:07
NitroNet installation - UnityConfig.cs
using System;
using Microsoft.Practices.Unity;
using System.Web.Hosting;
using NitroNet.ViewEngine.IO;
using NitroNet.UnityModules;
using System.Configuration;
namespace NitroNetMVC.App_Start
{
/// <summary>
@hombreDelPez
hombreDelPez / NitroNet.Sitecore-Global.asax.cs
Last active June 8, 2017 12:45
NitroNet.Sitecore installation - Global.asax.cs
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
using NitroNet.Sitecore;;
namespace NitroNetMVC
{
public class MvcApplication : System.Web.HttpApplication
{
protected void Application_Start()
@hombreDelPez
hombreDelPez / NitroNet-Global.asax.cs
Last active June 30, 2017 14:41
NitroNet installation - Global.asax.cs
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
using NitroNet.Mvc;
namespace NitroNetMVC
{
public class MvcApplication : System.Web.HttpApplication
{
protected void Application_Start()
@hombreDelPez
hombreDelPez / EnforceVersionPresEx3.cs
Created December 9, 2016 10:01
Enforce Version Presence Example 3
using (new EnforceVersionPresenceDisabler())
{
//Dein Code
}
@hombreDelPez
hombreDelPez / EnforceVersionPresEx2.cs
Created December 9, 2016 10:00
Enforce Version Presence Example 2
var language = Sitecore.Context.Language; //DE ist hier Kontextsprache
var item = Sitecore.Context.Database.GetItem("<id>", language);
var childItems = item.Children;