Skip to content

Instantly share code, notes, and snippets.

View merkle-sitecore-gists's full-sized avatar

Merkle DACH merkle-sitecore-gists

View GitHub Profile
@merkle-sitecore-gists
merkle-sitecore-gists / CustomPublishPipeline.config
Created April 1, 2019 16:01
CustomPublishPipeline.config
<?xml version="1.0"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<pipelines>
<publishItem>
<processor type="CustomerName.Web.Core.Pipelines.CustomerNameUpdatePublishingStatistics, CustomerName.Web.Core"
patch:after="processor[@type='Sitecore.Publishing.Pipelines.PublishItem.UpdateStatistics, Sitecore.Kernel']" />
</publishItem>
</pipelines>
</sitecore>
@merkle-sitecore-gists
merkle-sitecore-gists / CustomerNameUpdatePublishingStatistics.cs
Last active November 2, 2020 07:15
CustomerNameUpdatePublishingStatistics.cs
using System;
using Sitecore;
using Sitecore.Data;
using Sitecore.Data.Items;
using Sitecore.Diagnostics;
using Sitecore.Globalization;
using Sitecore.Publishing.Pipelines.PublishItem;
using Sitecore.SecurityModel;
using Version = Sitecore.Data.Version;
@merkle-sitecore-gists
merkle-sitecore-gists / CustomerName.Unicorn.Configs.Default.Master.config
Created April 1, 2019 15:58
CustomerName.Unicorn.Configs.Default.Master.config
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<unicorn>
<defaults>
<fieldFilter type="Rainbow.Filtering.ConfigurationFieldFilter, Rainbow" singleInstance="true">
<exclude fieldID="{34FECB70-C890-4671-A28B-37E65572DCB3}" note="'__Published' field on Statistics Section" />
<exclude fieldID="{DD4A2857-3EE1-44C1-94CD-121218B02852}" note="'__Published by' field on Statistics Section" />
</fieldFilter>
</defaults>
<configurations>
@merkle-sitecore-gists
merkle-sitecore-gists / MessageList.ascx.cs
Last active March 1, 2019 07:58
Bugfix for Sitecore 9 SocialConnect module adding bucket support for PostMessage and SocialMessages
...
public void BindGrid()
{
try
{
if (Request.QueryString["id"] != null)
{
var websitepageid = Request.QueryString["id"];
var messageFolder = Sitecore.Configuration.Factory.GetDatabase("master").GetItem("/sitecore/system/Social/PostMessage");
@merkle-sitecore-gists
merkle-sitecore-gists / MessageList.ascx.cs
Last active February 27, 2019 16:59
Bugfix for Sitecore 9 SocialConnect module fixing the social network window visibility
...
protected void PostFacebook(string ApplicationFacebookItemId)
{
try
{
this.ClearController(); // new line of code, clears all controller.
Database database = Factory.GetDatabase("master");
...
@merkle-sitecore-gists
merkle-sitecore-gists / MessageList.ascx.cs
Last active February 27, 2019 16:45
Bugfix for Sitecore 9 SocialConnect module creating items with an invalid name
...
protected void SavePostMessage(string network, string NewtworkPagename, string postid, string pageid, ....)
{
try
{
using (SecurityDisabler securityDisabler = new SecurityDisabler())
{
Database database = Factory.GetDatabase("master");
Item item = database.GetItem("/sitecore/system/Social/PostMessage");
TemplateItem template = database.GetTemplate(SocialTemplates.SocialMessages.ID);