Skip to content

Instantly share code, notes, and snippets.

Avatar

Mike Robbins komainu85

View GitHub Profile
@komainu85
komainu85 / DmsPageEventsManager.cs
Created May 17, 2017
Sitecore DMS Page Events Manager
View DmsPageEventsManager.cs
public class DmsPageEventsManager : IDmsPageEventsManager
{
readonly Guid _searchPageEventGuid = new Guid("{0C179613-2073-41AB-992E-027D03D523BF}");
readonly Guid _downloadPageEventGuid = new Guid("{FA72E131-3CFD-481C-8E15-04496E9586DC}";
private ICurrentPageContext CurrentPage()
{
return Tracker.Current.Session.Interaction.CurrentPage;
}
View SitecoreSSCWindowsIoT.cs
IHttpContent content = new HttpStringContent(@"{ ""domain"": ""sitecore"", ""username"": ""admin"", ""password"": ""b"" }", UnicodeEncoding.Utf8, "application/json");
using (var client = new Windows.Web.Http.HttpClient.HttpClient())
{
var result = await client.PostAsync(new Uri("https://192.168.1.112/Sitecore/api/ssc/auth/login"), content);
result.EnsureSuccessStatusCode();
var authResult = await result.Content.ReadAsStringAsync();
}
View Sitecore FXM.xml
<!-- Allow the FXM tracking beacon to be called by non-local clients (i.e. the end user's we are tracking) -->
<api>
<services>
<configuration type="Sitecore.Services.Infrastructure.Configuration.ServicesConfiguration, Sitecore.Services.Infrastructure">
<allowedControllers hint="list:AddController">
<allowedController desc="BeaconController">Sitecore.FXM.Service.Controllers.BeaconController, Sitecore.FXM.Service</allowedController>
<!-- Deploy to CM server only -->
<allowedController desc="DomainMatcherController">Sitecore.FXM.Service.Controllers.DomainMatcherController, Sitecore.FXM.Service</allowedController>
<allowedController desc="ElementMatcherController">Sitecore.FXM.Service.Controllers.ElementMatcherController, Sitecore.FXM.Service</allowedController>
<allowedController desc="ExperienceEditorComponentController">Sitecore.FXM.Service.Controllers.ExperienceEditorComponentController, Sitecore.FXM.Service</allowedC
@komainu85
komainu85 / SitecoreServicesClientAllowedControllers.xml
Created Oct 16, 2015
Sitecore Services Client Allowed Controllers
View SitecoreServicesClientAllowedControllers.xml
<?xml version="1.0"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<api>
<services>
<configuration type="Sitecore.Services.Infrastructure.Configuration.ServicesConfiguration, Sitecore.Services.Infrastructure">
<allowedControllers hint="list:AddController">
<allowedController desc="WallpaperController">MikeRobbins.WallpaperManager.Controllers.WallpaperController, MikeRobbins.WallpaperManager</allowedController>
</allowedControllers>
@komainu85
komainu85 / FriendlyUrl.cs
Last active Sep 10, 2015
Sitecore Friendly URL Computed Field
View FriendlyUrl.cs
using System.Xml;
using Sitecore.ContentSearch;
using Sitecore.ContentSearch.ComputedFields;
using Sitecore.Data.Items;
using Sitecore.Links;
using Sitecore.Xml;
namespace MikeRobbins.ContentSearch.ComputedFields
{
public class FriendlyUrl : AbstractComputedIndexField
View Form label animation with no-js fallback.markdown

Form label animation with no-js fallback

Simply add a surrounding element with a class name of "input-wrap" then add a class to your input, textarea etc... of "input-wrap__field" and you should see some sweet animation :)

A Pen by Matthew Neil on CodePen.

License.

@komainu85
komainu85 / HtmlAttributes.cs
Last active Nov 17, 2015
Razor Helpers Html Attributes Fluent API
View HtmlAttributes.cs
namespace MikeRobbins.SitecoreUtilities.RazorHelpers
{
public class HtmlAttributes
{
private NameValueCollection _nameValueCollection = new NameValueCollection();
public HtmlAttributes CssClass(string cssClass)
{
_nameValueCollection.Add("class", cssClass);
@komainu85
komainu85 / IDBinder.cs
Last active Aug 29, 2015
Sitecore ID Model Binder
View IDBinder.cs
using Sitecore.Data;
using System.Web.Mvc;
namespace MikeRobbins.SitecoreUtilities.ModelBinders
{
public class IDBinder : DefaultModelBinder
{
public override object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext)
{
ID id = ID.Null;
@komainu85
komainu85 / Automapper Adapter Pattern
Created Jul 17, 2015
Automapper Adapter Pattern
View Automapper Adapter Pattern
public class Mapper : IMapper
{
public T Map<S, T>(S source)
{
AutoMapper.Mapper.CreateMap<S, T>();
T result = AutoMapper.Mapper.Map<S, T>(source);
return result;
}
@komainu85
komainu85 / Open Content Editor Tab Within Custom Editor Sitecore.js
Last active Aug 29, 2015
Open Content Editor Tab Within Custom Editor Sitecore
View Open Content Editor Tab Within Custom Editor Sitecore.js
parent.scForm.postRequest(\'\', \'\', \'\', \'contenteditor:launchtab(url={ITEMIDHERE}, la={LANGUAGENAMEHERE}, datasource=sitecore)\')