Skip to content

Instantly share code, notes, and snippets.

View ReoKzK's full-sized avatar

Radoslaw Kozlowski ReoKzK

View GitHub Profile
@ReoKzK
ReoKzK / Feature.Content.Pipelines.config
Created December 18, 2019 12:05
Feature.Content.Pipelines.config
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<pipelines>
<renderField>
<!-- Inline tooltips renderer -->
<processor type="SitecoreCoffee.Feature.Content.Pipelines.RenderField.RenderTooltips, SitecoreCoffee.Feature.Content"
patch:after="processor[@type='Sitecore.Pipelines.RenderField.GetFieldValue, Sitecore.Kernel']" />
</renderField>
</pipelines>
</sitecore>
@ReoKzK
ReoKzK / RenderTooltips.cs
Created December 18, 2019 11:53
RenderTooltips.cs
using HtmlAgilityPack;
using Sitecore;
using Sitecore.Data;
using Sitecore.Pipelines.RenderField;
using System;
using System.Linq;
using System.Text.RegularExpressions;
namespace SitecoreCoffee.Feature.Content.Pipelines.RenderField
{
@ReoKzK
ReoKzK / Quotes.cs
Created April 9, 2019 10:08
Computed index field for indexing rendering datasources
public class Quotes : ComponentDataFieldBase, IComputedIndexField
{
public Quotes()
{
RenderingId = new Guid("{607E275A-7EEC-413F-95F8-F1B71DFCE27B}");
FieldNames = new List<string>()
{
"Title"
};
FieldNamesRichText = new List<string>();
@ReoKzK
ReoKzK / ComponentDataFieldBase.cs
Created April 9, 2019 10:02
Base class for component datasource indexing computed field
public abstract class ComponentDataFieldBase
{
/// <summary>
/// Index field name
/// </summary>
public string FieldName { get; set; }
/// <summary>
/// Index field return type
/// </summary>
@ReoKzK
ReoKzK / SitecoreHelper.Decompiled.Part.cs
Created November 30, 2018 12:23
Decompiled GetRendering method from SitecoreHelper
protected virtual Rendering GetRendering(string renderingType, object parameters, params string[] defaultValues)
{
Rendering rendering = new Rendering()
{
RenderingType = renderingType
};
int index = 0;
while (index < defaultValues.Length - 1)
{
rendering[defaultValues[index]] = defaultValues[index + 1];
@ReoKzK
ReoKzK / Install-Sitecore9.ps1
Last active November 24, 2018 19:08
Sitecore 9 installation script
# Sitecore 9 Installer
# Credits to George Chang - https://blogs.perficient.com/sitecore/2017/10/23/how-to-install-sitecore-9-with-the-sitecore-install-framework/
# Parameters config
$installConfig =
@{
SitecoreVersion = "9.0.2 rev. 180604"
Prefix = "sc90"
WebRoot = "C:\inetpub\wwwroot"
@ReoKzK
ReoKzK / SitecoreHelperExtensions.cs
Created November 24, 2018 15:12
SitecoreHelper extension methods
using Sitecore.Mvc.Helpers;
namespace SitecoreCoffee.Foundation.Extensions
{
public static class SitecoreHelperExtensions
{
/// <summary>
/// Gets current rendering prperty
/// </summary>
/// <param name="sitecoreHelper">SitecoreHelper instance</param>
@ReoKzK
ReoKzK / Install-SIF.ps1
Created November 11, 2018 13:06
SIF Installation Script
# SIF Installation Script
## Verify elevated
## https://superuser.com/questions/749243/detect-if-powershell-is-running-as-administrator
$elevated = [bool](([System.Security.Principal.WindowsIdentity]::GetCurrent()).groups -match "S-1-5-32-544")
if($elevated -eq $false)
{
throw "In order to install SIF, please run this script elevated."
}
@ReoKzK
ReoKzK / SitecoreCoffee.Project.Common.config.xml
Created October 12, 2018 11:18
Variables configuration patch
<?xml version="1.0"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<sc.variable name="unicornSourceFolder" value="d:\Projects\SitecoreCoffee\src\" />
</sitecore>
</configuration>
@ReoKzK
ReoKzK / SitecoreCoffee.Foundation.Serialization.config.xml
Created October 12, 2018 10:56
Helix structure Unicorn configuration
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<unicorn>
<configurations>
<configuration name="Foundation.Serialization"
description="Serialization configuration for Helix structure">
<targetDataStore physicalRootPath="$(unicornSourceFolder)\$(layer)\$(module)\serialization" type="Rainbow.Storage.SerializationFileSystemDataStore, Rainbow" useDataCache="false" singleInstance="true" />