This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class EnsureLanguageWriteAccess | |
{ | |
public int Limit | |
{ | |
get; | |
set; | |
} | |
public void Process(Sitecore.Pipelines.Save.SaveArgs args) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static string ReadFallbackValue(Field field, Item item) | |
{ | |
var fallbackItem = item.GetFallbackItem( MasterLanguage); | |
// makes 3 step renderings, currentitem -> fallback -> standard value | |
if (!TemplateManager.IsTemplate(item) && field.ID == Sitecore.FieldIDs.LayoutField && fallbackItem != null && fallbackItem.Versions.Count > 0 ) | |
{ | |
Field field1 = fallbackItem.Fields[field.ID]; | |
if (!field1.ContainsStandardValue) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class EnsureLanguageWriteAccess | |
{ | |
protected void OnItemSaving(object sender, EventArgs args) | |
{ | |
Item item = Event.ExtractParameter(args, 0) as Item; | |
Error.AssertNotNull(item, "No item in parameters"); | |
var itemlang = item.Database.GetItem(string.Format("/sitecore/system/Languages/{0}", item.Language)); | |
if (itemlang != null && Sitecore.Security.AccessControl.AuthorizationManager.IsDenied(itemlang | |
, Sitecore.Security.AccessControl.AccessRight.LanguageWrite |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// The layout data sources are saved with a text path and not a guid. | |
/// </summary> | |
public class EnsureDataSourceIsGUID | |
{ | |
public void OnItemSaving(object sender, EventArgs args) | |
{ | |
Sitecore.Diagnostics.Log.Info("Running EnsureDataSourceIsGUID", this); | |
Item item = Event.ExtractParameter(args, 0) as Item; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Class used to update Spot Context Data, when copying trees in Sitecore. | |
/// </summary> | |
public class LayoutDataSourceReferenceUpdater | |
{ | |
#region Properties | |
/// <summary> | |
/// Gets or sets the new root Item (source item). | |
/// </summary> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Text; | |
using System.Web; | |
using System.Xml; | |
using Microsoft.Build.Framework; | |
using Microsoft.Build.Utilities; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Large blob data in test/uat environments is just wastefull use of disk space | |
SP_SPACEUSED [Blobs] | |
-- FINDING ItemIds FOR RELEVANT FIELDS | |
-- File > Information > Extension Field | |
select * from Items where ID like 'C06867FE-9A43-4C7D-B739-48780492D06F' | |
-- File > Media > Blob Field | |
select * from Items where ID like '40E50ED9-BA07-4702-992E-A912738D32DC' | |
-- Examining the data location of the fields |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Web; | |
using Sitecore; | |
using Sitecore.Configuration; | |
using Sitecore.Diagnostics; | |
using Sitecore.Layouts; | |
using Sitecore.Pipelines.HttpRequest; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using Sitecore.Data.Items; | |
using Sitecore.Data.Managers; | |
using Sitecore.Globalization; | |
using Sitecore.Pipelines.GetContentEditorWarnings; | |
namespace SitecoreExtensions.Pipelines.GetContentEditorWarnings |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Try to match the local date format of the browser | |
var userLanguages = LanguageItem.GetRequestUserLanguages(); | |
// Ignore if no language preferences | |
if (userLanguages != null) | |
{ | |
var culture = CultureInfo.CreateSpecificCulture(userLanguages.First().IsoCode); | |
return Updated.ToString("d", culture); | |
} | |
return Updated.ToString("dd.MM.yyyy"); |
OlderNewer