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
# Root path to look 'orphan' items under - update here as needed | |
cd 'master:/sitecore/media library' | |
$counter = 0 | |
$itemsToProcess = Get-ChildItem -Recurse . | Where-Object { $_.TemplateName -ne 'Media Folder' } | |
if ($itemsToProcess -ne $null) { | |
$itemsToProcess | ForEach-Object { | |
$referrers = Get-ItemReferrer -Item $_ | measure | |
if ($referrers.Count -eq 0) { | |
$counter++ |
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
function Get-ComputedDependencyGraphUrl { | |
[CmdletBinding()] | |
param( | |
[Parameter(Mandatory=$true, Position=0 )] | |
[Hashtable]$allDependenciesClean | |
) | |
begin { | |
Write-Verbose "Cmdlet Get-ComputedDependencyGraphUrl - Begin" | |
} |
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
$databaseName = $actionData["databaseName"] | |
$filename = $actionData["filename"] | |
$resourceLoaderType = ([System.Type]::GetType("Sitecore.Data.DataProviders.ReadOnly.Protobuf.IResourceLoader, Sitecore.Data.ResourceItems.ProtobufNet")) | |
$resourceLoader = [Sitecore.DependencyInjection.ServiceLocator]::ServiceProvider.GetService($resourceLoaderType) | |
$paths = [System.Collections.Generic.List[String]]@() | |
$paths.Add([Sitecore.MainUtil]::MapPath("/App_Data/items/$($databaseName)/$($filename)")) > $null | |
$paths.Add([Sitecore.MainUtil]::MapPath("/sitecore modules/items/$($databaseName)/$($filename)")) > $null | |
$defaultFieldValues = New-Object -TypeName 'System.Collections.Generic.Dictionary[[guid], [string]]' | |
$database = [Sitecore.Configuration.Factory]::GetDatabase($databaseName) |
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 GraphQL.Types; | |
using Newtonsoft.Json; | |
using Sitecore.Configuration; | |
using Sitecore.Data.Items; | |
using Sitecore.Data.Fields; | |
using Sitecore.Diagnostics; | |
using Sitecore.LayoutService.Serialization.FieldSerializers; | |
using Sitecore.LayoutService.Serialization.ItemSerializers; | |
using Sitecore.LayoutService.Serialization.Pipelines.GetFieldSerializer; | |
using Sitecore.Services.GraphQL.Content.GraphTypes; |
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
import React, { useEffect, useState } from 'react'; | |
import { withSitecoreContext, dataApi, Placeholder } from '@sitecore-jss/sitecore-jss-react'; | |
import { dataFetcher } from './dataFetcher'; | |
import config from './temp/config'; | |
const HybridPlaceholder = ({ | |
name, | |
rendering, | |
sitecoreContext, | |
}) => { |
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
<%@ Page Language="C#" AutoEventWireup="true" %> | |
<%@ Import Namespace="Sitecore.Configuration" %> | |
<%@ Import Namespace="System" %> | |
<%@ Import Namespace="System.Xml" %> | |
<% | |
XmlDocument configuration = Factory.GetConfiguration(); | |
Response.ContentType = "application/xml"; | |
Response.Write(configuration.OuterXml); |
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
<%@ Page Language="C#" AutoEventWireup="true" %> | |
<%@ Import Namespace="Sitecore.Configuration" %> | |
<%@ Import Namespace="System" %> | |
<%@ Import Namespace="System.Xml" %> | |
<% | |
XmlDocument configuration = Factory.GetConfiguration(); | |
Response.ContentType = "application/xml"; | |
Response.Write(configuration.OuterXml); |
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
#!/bin/bash | |
dry_run=0 | |
usage() | |
{ | |
cat << EOF | |
usage: $0 [-n] ["string_to_date"] | |
Remove branches older than specified, human-readable date passed as a param |
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
DECLARE @SharedFieldId UniqueIdentifier = '{BE351A73-FCB0-4213-93FA-C302D8AB4F51}' /* Shared checkbox */ | |
DECLARE @UnversionedFieldId UniqueIdentifier = '{39847666-389D-409B-95BD-F2016F11EED5}' /* unversioned checkbox */ | |
DECLARE @TemplateFieldId UniqueIdentifier = '{455A3E98-A627-4B40-8035-E683A0331AC7}' /* Template field */ | |
-- Find all templates WHERE both "Unversioned" AND "Shared" is selected: | |
-- "Shared" will have precedense, so the "Unversioned" checkbox can be removed | |
SELECT * FROM SharedFields | |
WHERE FieldId=@UnversionedFieldId AND [Value] = '1' | |
AND ItemId IN (SELECT ItemId FROM SharedFields WHERE FieldId=@SharedFieldId AND [Value]='1') |
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
function Resolve-MsBuild { | |
$msb2017 = Resolve-Path "${env:ProgramFiles(x86)}\Microsoft Visual Studio\*\*\MSBuild\*\bin\msbuild.exe" -ErrorAction SilentlyContinue | |
if($msb2017) { | |
Write-Host "Found MSBuild 2017 (or later)." | |
Write-Host $msb2017 | |
return $msb2017 | |
} | |
$msBuild2015 = "${env:ProgramFiles(x86)}\MSBuild\14.0\bin\msbuild.exe" |
NewerOlder