Skip to content

Instantly share code, notes, and snippets.

View martinrayenglish's full-sized avatar

Martin English martinrayenglish

View GitHub Profile
@martinrayenglish
martinrayenglish / BrokenLinksEraser.aspx
Last active September 28, 2020 12:41
Improved Version of Sitecore Broken Links Removal tool
<%@ Page Language="c#" EnableEventValidation="false" AutoEventWireup="true" EnableViewState="false" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="Sitecore.Links" %>
<%@ Import Namespace="Sitecore.SecurityModel" %>
<%@ Import Namespace="Sitecore.StringExtensions" %>
<%@ Import Namespace="Sitecore.Collections" %>
<%@ Import Namespace="Sitecore.Configuration" %>
<%@ Import Namespace="Sitecore.Data" %>
<%@ Import Namespace="Sitecore.Data.DataProviders.Sql" %>
@martinrayenglish
martinrayenglish / Foundation.SitecoreExtensions.config
Created July 8, 2018 16:27
Patch to add custom processor to updateMongoDriverSettings pipeline
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<pipelines>
<updateMongoDriverSettings>
<processor type="MySite.Foundation.SitecoreExtensions.Pipelines.UpdateMongoDriverSettings.CustomMongoDriverSettings, MySite.Foundation.SitecoreExtensions">
<param desc="maxConnectionPoolSize">150</param>
<param desc="minConnectionPoolSize">20</param>
<param desc="maxConnectionIdleTimeSeconds">1500</param>
<param desc="maxConnectionLifeTimeSeconds">0</param>
</processor>
@martinrayenglish
martinrayenglish / CustomMongoDriverSettings.cs
Created July 8, 2018 16:16
Processor for updateMongoDriverSettings pipeline to alter MongoDB settings that are not available in the connection string
using System;
using Sitecore.Analytics.Pipelines.UpdateMongoDriverSettings;
using Sitecore.Diagnostics;
namespace MySite.Foundation.SitecoreExtensions.Pipelines.UpdateMongoDriverSettings
{
public class CustomMongoDriverSettings : UpdateMongoDriverSettingsProcessor
{
private readonly string _maxConnectionPoolSize;
@martinrayenglish
martinrayenglish / Sitecore.AzureDev.IndexDefinitions.config
Last active May 10, 2018 16:02
Patch file to update Sitecore Index names to allow developers to share an Azure Search Service. Simply set the environment variable and drop this file in the "Include/zzz" folder
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:set="http://www.sitecore.net/xmlconfig/set/">
<sitecore>
<sc.variable name="environment" value="martin_dev_" />
<contentSearch>
<configuration>
<indexes>
<index id="sitecore_master_index" type="Sitecore.ContentSearch.Azure.CloudSearchProviderIndex, Sitecore.ContentSearch.Azure">
<param desc="name" patch:instead="param[@desc='name']">$(environment)$(id)</param>
</index>
<index id="sitecore_web_index" type="Sitecore.ContentSearch.Azure.CloudSearchProviderIndex, Sitecore.ContentSearch.Azure">
@martinrayenglish
martinrayenglish / PowershellRedirectImport.ps1
Created December 11, 2016 14:16
Powershell script that targets a CSV file in the media library and creates simple redirect items for each data record
<#
.SYNOPSIS
Script targets a CSV file in the media library and creates simple redirect items for each data record
.NOTES
Martin English
#>
#Target csv file in media library
$media = "/sitecore/media library/import-data"