Skip to content

Instantly share code, notes, and snippets.

@jammykam
jammykam / ControlSources
Last active August 29, 2015 14:16
Custom Sitecore Control for storing Key/Value Data with Lookups
<configuration xmlns:x="http://www.sitecore.net/xmlconfig/">
<sitecore>
<controlSources>
<source mode="on" namespace="MyProject.Shell" assembly="MyProject" prefix="contentExtension"/>
</controlSources>
</sitecore>
</configuration>
@jammykam
jammykam / CustomLookup.cs
Last active August 29, 2015 14:16
Custom Lookup Field with labels
using System;
using System.Collections.Specialized;
using System.Web;
using System.Web.UI;
using Sitecore;
using Sitecore.Data.Items;
using Sitecore.Diagnostics;
using Sitecore.Shell.Applications.ContentEditor;
using Sitecore.StringExtensions;
using Sitecore;
using Sitecore.Diagnostics;
using Sitecore.Resources;
using Sitecore.Web.UI;
using Telerik.Web.UI;
using Sitecore.Data.Items;
namespace RTEDropList
{
public class EditorConfiguration : Sitecore.Shell.Controls.RichTextEditor.EditorConfiguration
using System;
using System.Collections.Generic;
using System.Linq;
using Sitecore.Data.Items;
using Sitecore.Diagnostics;
using Sitecore.Web.UI.HtmlControls.Data;
namespace MyProject.CMS.Custom.Controls
{
public class QueryableTreelist : Sitecore.Shell.Applications.ContentEditor.TreeList
@jammykam
jammykam / InsertFormWizard.cs
Last active January 22, 2016 02:39
Updated form selector to allow selection of existing forms
using System;
using System.Text;
using Sitecore;
using Sitecore.Data.Items;
using Sitecore.Globalization;
using Sitecore.Web.UI.HtmlControls;
using Sitecore.Web.UI.Sheer;
namespace Sitecore.Custom.WFFM.UI
{
@jammykam
jammykam / SOLR Switch Single Core.xml
Last active October 19, 2016 21:13
SOLR Switch Config
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<settings>
<setting name="ContentSearch.Solr.ServiceBaseAddress">
<patch:attribute name="value">http://localhost:8984/solr</patch:attribute>
</setting>
</settings>
<contentSearch>
<configuration>
<indexes hint="list:AddIndex">
@jammykam
jammykam / ConfigReader.cs
Last active October 20, 2016 12:28
Custom Sitecore ConfigReader to allow setting custom include folder locations
using System.Configuration;
using System.Xml;
using Sitecore;
using Sitecore.Configuration;
using Sitecore.Diagnostics;
namespace MyProject.Custom
{
class ConfigReader : Sitecore.Configuration.ConfigReader
{
@jammykam
jammykam / TDS Post-Deploy Anti-Update Rollback Package.cs
Created January 24, 2017 09:41
TDS Post-Deploy Step to generate anti-update rollback package - http://wp.me/p2SmN4-fh
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Xml.Linq;
using HedgehogDevelopment.SitecoreProject.PackageInstallPostProcessor.Contracts;
using Sitecore.Diagnostics;
namespace ForwardSlash.TDS.PostDeploy
{
[Description("Generate anti-update rollback package for latest deployment.")]
@jammykam
jammykam / SelectRendering.xml
Created October 5, 2015 13:14
Updated Sitecore Tabbed Select Rendering Dialog
<?xml version="1.0" encoding="utf-8" ?>
<control xmlns:def="Definition" xmlns="http://schemas.sitecore.net/Visual-Studio-Intellisense">
<Sitecore.Shell.Applications.Dialogs.SelectRendering>
<FormDialog ID="Dialog" Icon="Core/32x32/open_document.png" Header="Open Item"
Text="Select the item that you wish to open. Then click the Open button." OKButton="Open">
<Stylesheet Src="SelectItemWithThumbnails.css" DeviceDependant="true" />
<CodeBeside Type="MyProject.Custom.Dialogs.SelectRenderingTabbed.SelectRenderingForm, MyProject.Custom"/>
<DataContext ID="DataContext" Root="/"/>
@jammykam
jammykam / ShowTitleWhenBlank.cs
Last active August 15, 2017 20:44
Display Field Title alongside default [No text in field] placeholder when value not set - https://ticdevs.com/developers/presentation/page-editor/fixing-blank-fields - Thanks for @nshack31 for the find
using Sitecore.Pipelines.RenderField;
namespace MyProject.CMS.Custom.Pipelines.RenderField
{
public class ShowTitleWhenBlank
{
public void Process(RenderFieldArgs args)
{
args.RenderParameters["show-title-when-blank"] = "true";
}