Skip to content

Instantly share code, notes, and snippets.

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;
<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>
## 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)
@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
{
    Contact: {
        ContactId: "590e2bb3-abce-48b9-996f-9efbd923eee6",
        ContactSaveMode: 0,
        Extensions: {
            SimpleValues: {}
        },
        Facets: {
            Personal: {
<?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>
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)
{