Skip to content

Instantly share code, notes, and snippets.

@jammykam
jammykam / CheckboxWithHtml.cs
Last active October 4, 2017 18:16
Sitecore WFFM Checkbox With HTML field
using Sitecore.Form.Core.Attributes;
using Sitecore.Form.Core.Visual;
namespace MyProject.CMS.Custom.WFFM.Fields
{
public class CheckboxWithHtml : Sitecore.Form.Web.UI.Controls.Checkbox
{
private string _htmlText;
[VisualCategory("Appearance")]
@jammykam
jammykam / PlaceholderInput.cs
Created October 4, 2017 18:07
Sitecore WFFM Input field with Placeholder
using System.ComponentModel;
using Sitecore.Form.Core.Attributes;
namespace MyProject.CMS.Custom.WFFM.Fields
{
public class PlaceholderInput : Sitecore.Form.Web.UI.Controls.SingleLineText
{
[DefaultValue("")]
[VisualCategory("Appearance")]
[VisualProperty("Placeholder Text:", 200)]
@jammykam
jammykam / EmailPlaceholder.cs
Last active October 4, 2017 18:03
Sitecore WFFM Email Field with Placeholder Text
using System.ComponentModel;
using Sitecore.Form.Core.Attributes;
namespace MyProject.CMS.Custom.WFFM.Fields
{
public class EmailPlaceholder : Sitecore.Form.Web.UI.Controls.Email
{
public new string Text
{
get { return this.textbox.Text; }
@jammykam
jammykam / ServicesConfigurationRegistration.config
Last active November 12, 2017 13:10
A SwitchingLinkManager for Sitecore 8.2 allowing you to use a different LinkProvider per site
<?xml version="1.0"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:set="http://www.sitecore.net/xmlconfig/set/">
<sitecore>
<services>
<configurator type="Sitecore.Custom.Providers.ServicesConfigurator, Sitecore.Custom" />
</services>
</sitecore>
</configuration>
@jammykam
jammykam / ExtractPostProcessDllFromPackage.cs
Created September 20, 2017 22:05
Extract DLLs from TDS Update Packages
using Ionic.Zip;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Comcast.ExtractPostProcessDllFromPackage
{
@jammykam
jammykam / GlassEditFrame.cs
Last active September 10, 2017 04:30
Glass Edit Frame - Custom frame wrapper and pop up handler
using System;
using System.Linq.Expressions;
using System.Web;
using System.Web.Mvc;
using Glass.Mapper.Sc;
namespace MyProject.Custom.HtmlHelpers
{
public static class GlassEditFrameExtensions
{
@jammykam
jammykam / ExperienceEditorExtension.js
Last active September 8, 2017 21:30
Sitecore 8 Experience Editor – Edit Component Properties causes page to jumps to top
Sitecore.PageModes.ChromeControls = Sitecore.PageModes.ChromeControls.extend({
renderCommandTag: function (command, chrome, isMoreCommand) {
var tag = this.base(command, chrome, isMoreCommand);
if (command.click.indexOf("chrome:") == 0) {
if (command.type == "common" || command.type == "datasourcesmenu" || command.type == "workflow") {
tag.click(function (e) {
e.stop();
});
}
@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";
}
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
@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.")]