Skip to content

Instantly share code, notes, and snippets.

@dresser
dresser / wheresmyrendering.ps1
Created November 29, 2020 00:34
Sitecore PowerShell Extensions Script for finding pages where a rendering is used
# 1) Path to Presentation node of your Site
$presentationPath = "/sitecore/content/TennantGroup/Tennant/Shared Website/Presentation"
# 2) IDs for derived Metadata Partial Design template
$metadataPartialDesignTemplateId = "{C546A218-0707-4B3E-905B-EBD866533AE7}"
# 3) ID for derived Partial Design template
$partialDesignTemplateId = "{341CDBE1-FE54-47F5-AAB9-016AC4FA8C0D}"
# 4) ID for derived Page Design template
$pageDesignTemplateId = "{39543BFF-CE95-40D3-9873-E5E5A0E1BDFF}"
# 5) Path for Home page
$homePagePath = "/sitecore/content/TennantGroup/Tennant/Developer Website/Home"
@dresser
dresser / RecycleBin.aspx
Created February 14, 2018 20:37
Sitecore admin recycle bin page to allow searching for deleted items by ID
<%@ Page Language="C#" AutoEventWireup="true" Debug="true" %>
<%@ Import Namespace="Sitecore.Data" %>
<%@ Import Namespace="Sitecore.Data.Archiving" %>
<%@ Import Namespace="System.Linq" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Oscar - Recycle Bin Utility</title>
<link rel="Stylesheet" type="text/css" href="/sitecore/shell/themes/standard/default/WebFramework.css" />
void Main()
{
var guid = new Guid();
guid.ToString("N").Dump(); //Returns "00000000000000000000000000000000"
guid.ToString("D").Dump(); //Returns "00000000-0000-0000-0000-000000000000"
guid.ToString("P").Dump(); //Returns "(00000000-0000-0000-0000-000000000000)"
guid.ToString("B").Dump(); //Returns "{00000000-0000-0000-0000-000000000000}"
guid.ToString("X").Dump(); //Returns "{0x00000000,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}"
//ID.Parse