Skip to content

Instantly share code, notes, and snippets.

@Refactored
Refactored / EncodeNameReplacements.config
Created December 5, 2013 14:48
Sitecore App_Config\Include overrides to get encodeNameReplacements to replace spaces with dashes. This also shows using display names with linkProvider.
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<encodeNameReplacements>
<replace mode="on" find=" " replaceWith="-" />
</encodeNameReplacements>
</sitecore>
</configuration>
@Refactored
Refactored / gist:6776801
Created October 1, 2013 10:53
IndexRebuild.aspx
<%@ Page Language="C#" AutoEventWireup="true" Inherits="System.Web.UI.Page" Debug="true" %>
<%@ Import Namespace="Sitecore" %>
<%@ Import Namespace="Sitecore.Configuration" %>
<%@ Import Namespace="Sitecore.Jobs" %>
<%@ Import Namespace="Sitecore.Search" %>
<!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 runat="server">
<title>Rebuild database crawlers</title>
private void CreateItem(IWorkflow workflow, Item item, System.Web.UI.Control control)
{
Assert.ArgumentNotNull(workflow, "workflow");
Assert.ArgumentNotNull(item, "item");
Assert.ArgumentNotNull(control, "control");
XmlControl webControl = Resource.GetWebControl("WorkboxItem") as XmlControl;
Assert.IsNotNull(webControl, "workboxItem is null");
control.Controls.Add(webControl);
StringBuilder builder = new StringBuilder(" - (");
Language language = item.Language;
<CodeBeside Type="Heinemann.DigitalCampus.Framework.Shell.Applications.Workbox.WorkboxForm,Heinemann.DigitalCampus.Framework"/>
<Border Margin="5px 0px 8px 0px">
<Literal Foreground="#999999" Text="Path:"/>&#160;<Literal Text="$Path"/>&#160;
</Border>
@Refactored
Refactored / gist:1197983
Created September 6, 2011 16:01
Sitecore Item.IsOf
public static class SitecoreItemExtensions
{
public static bool IsOf(this Sitecore.Data.Items.Item item, Sitecore.Data.ID templateId)
{
if (item.TemplateID == templateId) return true;
foreach (Sitecore.Data.Items.TemplateItem ti in item.Template.BaseTemplates)
{
if (ti.ID == templateId) return true;
}