Skip to content

Instantly share code, notes, and snippets.

@Wesley-Lomax
Wesley-Lomax / QueryableTreeList.cs
Created March 14, 2017 11:28
Sitecore Queryable TreeList - https://community.sitecore.net/developers/f/8/t/1673 Sample Usage - Datasource=query:./ancestor-or-self::*[@@TemplateName='Tabs Listing Folder']/Tabs&IncludeTemplatesForSelection=BaseTab
using Sitecore;
using Sitecore.Data.Items;
using Sitecore.Shell.Applications.ContentEditor;
namespace RCN.Core.Controls
{
public class QueryableTreelist : TreeList
{
private const string QueryKey = "query:";
@Wesley-Lomax
Wesley-Lomax / sitecore-winmerge
Created March 9, 2017 15:36
WinMerge - Exclude Sitecore directory and files from compare.
## This is a directory/file filter template for WinMerge
name: Sitecore Webroot
desc: Exclude temp and Media_Cache
## Select if filter is inclusive or exclusive
## Inclusive (loose) filter lets through all items not matching rules
## Exclusive filter lets through only items that match to rule
## include or exclude
def: include
@Wesley-Lomax
Wesley-Lomax / ItemIsLockedWarning.cs
Last active January 13, 2017 11:51
Experience Editor Locked Item Improvisations Sitecore 8 Update 5
using Sitecore.Data.Items;
using Sitecore.Pipelines.GetPageEditorNotifications;
namespace WesleyLomax.Business.Pipelines
{
public class ItemIsLockedWarning
{
public void Process(GetPageEditorNotificationsArgs args)
{
Item item = args.ContextItem;
@Wesley-Lomax
Wesley-Lomax / SequentialNumber.cs
Last active October 21, 2016 10:34
WFFM - Sequential Number Custom Field
using System.ComponentModel;
using System.ComponentModel.Design;
using Sitecore.Configuration;
using Sitecore.Data;
using Sitecore.Data.Items;
using Sitecore.Form.Core.Attributes;
using Sitecore.Form.Web.UI.Controls;
using Sitecore.SecurityModel;
namespace WesleyLomax.WFFM
assembly-versioning-scheme: MajorMinorPatch
mode: ContinuousDelivery
branches: {}
@Wesley-Lomax
Wesley-Lomax / ShowMediaInfo.cs
Last active August 22, 2016 12:45
Render Media Url on to Sitecore item for Media Items Original Post - http://seankearney.com/post/Sitecore-Media-URL
using System.Text;
using Sitecore.Data.Items;
using Sitecore.Resources.Media;
using Sitecore.Shell;
using Sitecore.Shell.Applications.ContentEditor.Pipelines.RenderContentEditor;
using Sitecore.Text;
using Sitecore.Web.UI.HtmlControls;
namespace WesleyLomax.Pipelines
{
@Wesley-Lomax
Wesley-Lomax / mongodb3.yaml
Last active July 21, 2016 14:15
YAML Configurationf for MongoDB 3.2 xDB Sitecore Analytics Database using WiredTiger and zlib
systemLog:
destination: file
path: M:\MongoDB\dataWT\log\mongod.log
logAppend: true
storage:
dbPath: M:\MongoDB\dataWT\db
journal:
enabled: true
directoryPerDB: true
engine: wiredTiger
@Wesley-Lomax
Wesley-Lomax / serviceinstall.bat
Created June 30, 2016 12:58
Bitnami SOLR Install windows service with 64 bit java and increased memory heap
@echo off
rem -- Check if argument is INSTALL or REMOVE
if not ""%1"" == ""INSTALL"" goto remove
"C:\solr-4.10.3-0/apache-solr\scripts\prunsrv.exe" //IS//solrJetty --DisplayName="solrJetty" --Install="C:\solr-4.10.3-0/apache-solr\scripts\prunsrv.exe" --LogPath="C:\solr-4.10.3-0/apache-solr\logs" --LogLevel=Debug --StdOutput=auto --StdError=auto --StartMode=Java --StopMode=Java --Jvm=auto ++JvmOptions=-DSTOP.PORT=8079 ++JvmOptions=-DSTOP.KEY=s3crEt ++JvmOptions=-Djetty.home="C:\solr-4.10.3-0/apache-solr" ++JvmOptions=-Dsolr.solr.home="C:\solr-4.10.3-0/apache-solr/solr" --Jvm=auto ++JvmOptions=-Djetty.logs="C:\solr-4.10.3-0/apache-solr\logs" --JavaHome="C:\Program Files\Java\jre1.8.0_91" ++JvmOptions=-XX:MaxPermSize=128M ++JvmOptions=-Xms1G ++JvmOptions=-Xmx1G --Classpath="C:\solr-4.10.3-0/apache-solr\lib\*";"C:\solr-4.10.3-0/apache-solr\start.jar" --StartClass=org.eclipse.jetty.start.Main ++StartParams="C:\solr-4.10.3-0/apache-solr\etc\jetty.xml" --StopClass=org.eclipse.jetty.start.Main ++StopParams=--stop +
@Wesley-Lomax
Wesley-Lomax / sample_pubxml-profile.xml
Created June 9, 2016 09:36
Exclude files from deployment Visual Studio Web Publish
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
by editing this MSBuild file. In order to learn more about this please visit http://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>FileSystem</WebPublishMethod>
<LastUsedBuildConfiguration>Debug</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
@Wesley-Lomax
Wesley-Lomax / useful_sitecore_queries
Created May 31, 2016 08:37
Useful Sitecore queries
select * from /sitecore/layout/Renderings//*[@Cacheable = 1]