Skip to content

Instantly share code, notes, and snippets.

Jeffrey Rondeau JRondeau16

View GitHub Profile
View ContactUs.cs
public ActionResult ContactUs()
{
var model = new ContactUsViewModel();
if ((Tracker.Current != null) && (Tracker.Current.Contact != null))
{
var contact = Tracker.Current.Contact;
var personal = contact.GetFacet<IContactPersonalInfo>("Personal");
var phoneFacet = contact.GetFacet<IContactPhoneNumbers>("Phone Numbers");
var addressFacet = contact.GetFacet<IContactAddresses>("Addresses");
View IdentifyContact.config
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<pipelines>
<mvc.requestBegin>
<processor type="YourNamespace.Pipelines.MvcRequestBegin, YourNamespace"
patch:after="processor[@type='Sitecore.Mvc.Analytics.Pipelines.MvcEvents.RequestBegin.StartTracking, Sitecore.Mvc.Analytics']"/>
</mvc.requestBegin>
</pipelines>
</sitecore>
</configuration>
@JRondeau16
JRondeau16 / IdentifyContact.cs
Created Jun 27, 2018
Populate Sitecore Contact Data from Salesforce Marketing Cloud
View IdentifyContact.cs
using System;
using System.Linq;
using Sitecore.Analytics;
using Sitecore.Analytics.Tracking;
using Sitecore.Diagnostics;
using Sitecore.Mvc.Pipelines.Request.RequestBegin;
using Sitecore.Analytics.Model.Entities;
using Sitecore.Analytics.Model.Framework;
namespace YourNamespace.Pipelines.MvcRequestBegin
@JRondeau16
JRondeau16 / ProjectName.Website.Web.Index.config
Created Nov 21, 2017
Lucene Index Configuration for Web Database - Sitecore 9
View ProjectName.Website.Web.Index.config
<?xml version="1.0"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:role="http://www.sitecore.net/xmlconfig/role/" xmlns:search="http://www.sitecore.net/xmlconfig/search/">
<sitecore role:require="ContentDelivery" search:require="lucene">
<contentSearch>
<configuration type="Sitecore.ContentSearch.ContentSearchConfiguration, Sitecore.ContentSearch">
<!--Index Configuration-->
</configuration>
</contentSearch>
</sitecore>
</configuration>
@JRondeau16
JRondeau16 / ProjectName.Website.Master.Index.config
Last active Nov 21, 2017
Lucene Index Configuration for Master Database - Sitecore 9
View ProjectName.Website.Master.Index.config
<?xml version="1.0"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:role="http://www.sitecore.net/xmlconfig/role/" xmlns:search="http://www.sitecore.net/xmlconfig/search/">
<sitecore role:require="Standalone or Reporting or ContentManagement or Processing" search:require="lucene">
<contentSearch>
<configuration type="Sitecore.ContentSearch.ContentSearchConfiguration, Sitecore.ContentSearch">
<!--Index Configuration-->
</configuration>
</contentSearch>
</sitecore>
</configuration>
@JRondeau16
JRondeau16 / SiteDefinition.config
Created Nov 21, 2017
SiteDefinition.config for Sitecore 9
View SiteDefinition.config
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:set="http://www.sitecore.net/xmlconfig/set/" xmlns:role="http://www.sitecore.net/xmlconfig/role/" xmlns:env="http://www.sitecore.net/xmlconfig/env/">
<sitecore>
<sites>
<!--Local-->
<site name="[ProjectName]" inherits="website"
rootPath="/sitecore/content/ProjectName"
hostName="*"
targetHostName="ProjectName.local.com"
patch:before="site[@name='website']" />
@JRondeau16
JRondeau16 / Settings.config
Created Nov 21, 2017
Settings.config Sitecore 9
View Settings.config
<?xml version="1.0"?>
<configuration
xmlns:patch="http://www.sitecore.net/xmlconfig/"
xmlns:set="http://www.sitecore.net/xmlconfig/set/"
xmlns:role="http://www.sitecore.net/xmlconfig/role/"
xmlns:env="http://www.sitecore.net/xmlconfig/env/">
<sitecore>
<settings>
<!--Local-->
<setting name="[ProjectName].Setting" value="abc123" env:require="Local" />
@JRondeau16
JRondeau16 / web.config
Created Nov 21, 2017
web.config Roles + Environments
View web.config
<appSettings>
<!--Local-->
<add key="env:define" value="Local" />
<add key="role:define" value="Standalone"/>
<!--Develop-->
<add key="env:define" value="Develop" />
<add key="role:define" value="Standalone"/>
<!--Beta-->
@JRondeau16
JRondeau16 / GetFields.cs
Created Jul 28, 2017
Get Fields Pipeline Override
View GetFields.cs
using Elision.Foundation.Kernel;
using Sitecore.Data.Fields;
using Sitecore.Data.Templates;
namespace Elision.Foundation.FieldVisibility.Pipelines.GetContentEditorFields
{
public class GetFields : Sitecore.Shell.Applications.ContentEditor.Pipelines.GetContentEditorFields.GetFields
{
protected override bool CanShowField(Field field, TemplateField templateField)
{
@JRondeau16
JRondeau16 / FieldVisibility.config
Created Jul 28, 2017
Hide With Standard Fields Config
View FieldVisibility.config
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:set="http://www.sitecore.net/xmlconfig/set/">
<sitecore>
<pipelines>
<getContentEditorFields>
<processor type="[YOUR_NAMESPACE].GetFields, [YOUR_NAMESPACE]"
patch:instead="processor[@type='Sitecore.Shell.Applications.ContentEditor.Pipelines.GetContentEditorFields.GetFields, Sitecore.Client']" />
</getContentEditorFields>
</pipelines>
You can’t perform that action at this time.