Skip to content

Instantly share code, notes, and snippets.

@craigtfromatl
craigtfromatl / item.txt
Created November 1, 2019 19:14
TDS gitattribute item update
*.item -text
@craigtfromatl
craigtfromatl / content-length-error.txt
Created November 1, 2019 19:12
An exception occurred while updating the sitecore item xxx
An exception occurred while updating the sitecore item xxx. Error reading item: xxx Length of field content does not match the content-length attribute.
@craigtfromatl
craigtfromatl / web.release.config
Created November 27, 2018 11:36
web.release.config for authentication mode
<?xml version="1.0" encoding="utf-8"?>
<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<system.web>
<compilation xdt:Transform="RemoveAttributes(debug)" />
@craigtfromatl
craigtfromatl / web.config.xml
Created November 27, 2018 11:08
Forms Authentication
<authentication mode="None" />
@craigtfromatl
craigtfromatl / CookieConsentPatch.xml
Created June 15, 2017 18:22
Patch include for cookie suppression
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<pipelines>
<httpRequestBegin>
<processor patch:after="processor[@type='Sitecore.Pipelines.HttpRequest.ItemResolver, Sitecore.Kernel']" type="Client.Extensions.SuppressLanguageCookie, Client.Extensions"/>
</httpRequestBegin>
<startAnalytics>
<processor patch:after="processor[@type='Sitecore.Analytics.Pipelines.StartAnalytics.CheckPreconditions, Sitecore.Analytics']" type="Client.Extensions.SuppressAnalyticsCookie, Client.Extensions">
<AnalyticsCookiePrefix>SC_ANALYTICS</AnalyticsCookiePrefix>
@craigtfromatl
craigtfromatl / CookieConsentDecoration.cs
Created June 15, 2017 18:14
Decorating a method with the AuthorizeAttribute with parameters
[CookieConsent (InvertLogic = true)]
@craigtfromatl
craigtfromatl / CookieConsentAttribute.cs
Last active June 15, 2017 19:24
Overriding the AuthorizeAttribute for Authorization filtering
using Client.Constants.Session;
using Client.Providers.CookieConsent;
using Sitecore;
using Sitecore.Data.Items;
using System;
using System.Web;
using System.Web.Mvc;
namespace Client.Website.Filters
{
@craigtfromatl
craigtfromatl / CookieConsentProviderBase.cs
Created June 15, 2017 17:49
Base abstract class that all providers will inherit.
using System.Configuration.Provider;
using System.Web;
namespace Client.Providers.CookieConsent
{
public abstract class CookieConsentProviderBase : ProviderBase
{
public abstract bool IsConsentRequired(string siteDomain, HttpContextBase currentContext, string siteLocale);
public abstract void SetConsent(string siteDomain, HttpContextBase currentContext, string siteLocale);
@craigtfromatl
craigtfromatl / sitecoredomain.xml
Created May 4, 2017 18:33
The Sitecore domain entry in Domains.config
<domain name="sitecore" ensureAnonymousUser="false" />
@craigtfromatl
craigtfromatl / DeletedDomain.txt
Created May 4, 2017 18:17
What it looks like when you delete the Sitecore domain
ManagedPoolThread #5 12:44:40 INFO AUDIT (sitecore\<Agency>admin): Deleted domain: sitecore
ManagedPoolThread #5 12:44:40 INFO Job ended: removing domains (units processed: 1)
3436 12:44:40 INFO Trying to load XML configuration /App_Config/Security/Domains.config
7548 12:44:40 INFO Config file modified: C:\Inetpub\wwwroot\<Client>\Website\App_Config\Security\Domains.config