Skip to content

Instantly share code, notes, and snippets.

using System.Web.Mvc;
using System.Web.Routing;
using Sitecore.Pipelines;
namespace Bonfire.Kickfire.Analytics.Pipelines.Initialize
{
public class InitRoutes : Sitecore.Mvc.Pipelines.Loader.InitializeRoutes
{
public override void Process(PipelineArgs args)
{
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<pipelines>
<initialize>
<processor type="Bonfire.Kickfire.Analytics.Pipelines.Initialize.InitRoutes, Bonfire.Kickfire.Analytics"
patch:before="processor[@type='Sitecore.Mvc.Pipelines.Loader.InitializeRoutes, Sitecore.Mvc']"/>
</initialize>
</pipelines>
</sitecore>
{
    Contact: {
        ContactId: "590e2bb3-abce-48b9-996f-9efbd923eee6",
        ContactSaveMode: 0,
        Extensions: {
            SimpleValues: {}
        },
        Facets: {
            Personal: {
@dnstommy
dnstommy / DeleteLanguageVersions.ps1
Created November 25, 2016 01:57
Deleting all versions of a language with SPE
$languageitems = Find-Item `
-Index sitecore_master_index `
-Criteria @{Filter = "Contains"; Field = "_language"; Value = "de-de"}, @{Filter = "StartsWith"; Field = "_fullpath"; Value = "/sitecore/content/" }
if($languageitems)
{
foreach($languageitem in $languageitems)
{
$id = $languageitem.ItemId
## Can use Path or ID to get the item
$newTemplate = Get-Item "{622A0FF0-2628-423B-9B79-3A7249804635}";
$searchItems = Find-Item `
-Index sitecore_master_index `
-Criteria @{Filter = "Equals"; Field = "_name"; Value = "Menus"},
@{Filter = "StartsWith"; Field = "_fullpath"; Value = "/sitecore/content/" }
@{Filter = "Equals"; Field = "templateid"; Value = "1e96593acae043acbaebf3497072b118" }
if($searchItems)
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<model>
<elements>
<element interface="YourApp.Analytics.Interfaces.Entries.IContactCustomerLookups, Bonfire.Kickfire.Analytics" implementation="YourApp.Analytics.Models.Generated.ContactCustomerLookups, YourApp" />
<element interface="YourApp.Analytics.Interfaces.Entries.IElementCustomerLookup, Bonfire.Kickfire.Analytics" implementation="YourApp.Analytics.Models.Generated.ElementCustomerLookup, YourApp" />
</elements>
<entities>
<contact>
<facets>
var companyInformationFacet = Tracker.Current.Contact.GetFacet<IContactCustomerLookups>("CompanyInformation");
if (!companyInformationFacet.Entries.Contains(CleanName(model.data[0].name)))
{
var customer = companyInformationFacet.Entries.Create(CleanName(model.data[0].name));
customer.name = model.name;
customer.CID = model.CID;
customer.category = model.category;
customer.city = model.city;
customer.confidence = model.confidence;
@dnstommy
dnstommy / SelectRendering.xml
Created January 19, 2017 01:17
Tabbed renderings dialog for Sitecore
<?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" />
<Script Src="/sitecore/shell/Applications/Dialogs/SelectRendering/dialog.js" />
<CodeBeside Type="Abbey.Web.Custom.Dialogs.CustomSelectRenderingForm, Abbey.Web"/>
@dnstommy
dnstommy / dialog.js
Created January 19, 2017 01:19
Javascript needed to resize the dialog box for tabbed renderings in Sitecore
document.addEventListener('DOMContentLoaded', function(){
var parentDiv = parent.document.getElementsByClassName("ui-dialog ui-widget ui-widget-content ui-corner-all ui-front ui-draggable ui-resizable");
if (parentDiv)
{
//console.log(all[0].style)
parentDiv[0].style.width = "1100px";
parentDiv[0].style.height = "600px";
}
<?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" />
<Stylesheet Src="/sitecore/shell/Applications/Dialogs/SelectRendering/dialog.css" DeviceDependant="true" />
<Script Src="/sitecore/shell/Applications/Dialogs/SelectRendering/dialog.js" />
<CodeBeside Type="Abbey.Web.Custom.Dialogs.CustomSelectRenderingForm, Abbey.Web"/>