Skip to content

Instantly share code, notes, and snippets.

View Sitecore.ContentSearch.Lucene.DefaultIndexConfiguration.config
<analyzer type="Sitecore.ContentSearch.LuceneProvider.Analyzers.PerExecutionContextAnalyzer, Sitecore.ContentSearch.LuceneProvider">
<param desc="defaultAnalyzer" type="Sitecore.ContentSearch.LuceneProvider.Analyzers.DefaultPerFieldAnalyzer, Sitecore.ContentSearch.LuceneProvider">
<param desc="defaultAnalyzer" type="Lucene.Net.Analysis.Standard.StandardAnalyzer, Lucene.Net">
<!-- To run a different version of Lucene, change the version.
Usage: If a problem is found in the latest version to Lucene and a previous version is more stable, you can change the version
attribute and run in the version that is stable e.g. Lucene_29 or Lucene_23.
-->
<param hint="version">Lucene_30</param>
</param>
</param>
@komainu85
komainu85 / Sitecore Image Url Computed Field
Created Feb 18, 2015
Sitecore Image Url Computed Field
View Sitecore Image Url Computed Field
public class ImageUrl : IComputedIndexField
{
public object ComputeFieldValue(Sitecore.ContentSearch.IIndexable indexable)
{
Item item = indexable as SitecoreIndexableItem;
if (item != null)
{
var fileField = ((FileField)item.Fields["Image"];
@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;
}
@komainu85
komainu85 / 1. RegisterWebApiRoute.cs
Last active Jun 29, 2016
Web API Registration Sitecore
View 1. RegisterWebApiRoute.cs
public class RegisterWebApiRoute
{
public void Process(PipelineArgs args)
{
var config = GlobalConfiguration.Configuration;
config.Routes.MapHttpRoute("DefaultApiRoute",
"MikeAPI/{controller}/{action}/{id}",
new { id = RouteParameter.Optional });
@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>
View Sitecore Item Comparer
public class ItemComparer : IEqualityComparer<Item>
{
public bool Equals(Item x, Item y)
{
return x.ID == y.ID;
}
public int GetHashCode(Item obj)
{
return obj.ID.GetHashCode();
@komainu85
komainu85 / gist:2b5bf03018a85b5ab824
Created Jun 2, 2015
Dev sitecore 8 config from Alex Shyba
View gist:2b5bf03018a85b5ab824
<!--
IMPORTANT: This configuration file is not intended for any production Sitecore installation.
Purpose: This include file contains some experimental optimizations that can speed up start-up.
Please, review each of the patched elements below and consider if some of the optimizations should be commented out due to the specifics of your solution.
Enabling this file without taking into account the specifics of your solution can have unexpected consequences.
To enable this include file, rename it to have a ".config" extension.
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();
}
@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);
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