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 Swap-DataSource ($item, $renderingToUpdate, $renderingDataSourceIdToAdd, $useFinalLayout) { | |
$renderingItem = Get-Item -Path $renderingToUpdate.ItemID | |
Write-Host "Swaping Rendering Datasource: $($renderingId.UniqueID) - '$($renderingItem.Name)' to: $($renderingDataSourceIdToAdd) for Item: $($item.Name)" | |
$renderingToUpdate.Datasource = $renderingDataSourceToAdd | |
Set-Rendering -Item $item -Instance $renderingToUpdate -FinalLayout:$useFinalLayout | |
} |
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
Param( | |
$solrVersion = "7.2.1", | |
$installFolder = "C:\solr", | |
$solrPort = "8983", | |
$solrHost = "solr-910", | |
$solrSSL = $true, | |
$nssmVersion = "2.24", | |
$JREVersion = "9.0.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
protected void SwitchPrimaryIndex(string indexName, string machineName, bool isCd) | |
{ | |
//get key | |
var indexKey = GetIndexKey(indexName, machineName, isCd); | |
//get current primary key name | |
var currentPrimaryIndexName = database.Properties[indexKey]; | |
//default to this as new index name | |
var newPrimaryIndexName = currentPrimaryIndexName; |
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
<configuration name="Shared" description="Shared Unicorn Config"> | |
<predicate> | |
<include name="SharedPageLayouts" database="master" path="/sitecore/layout/Layouts/Shared" /> | |
<include name="SharedTemplates" database="master" path="/sitecore/templates/Shared" /> | |
<include name="SharedNavigation" database="master" path="/sitecore/content/Shared/Navigation" fieldTransforms="-Home Link"> | |
</predicate> | |
<!--exclude the Navigation 'Home Link' field--> | |
<fieldFilter type="Rainbow.Filtering.ConfigurationFieldFilter, Rainbow"> | |
<exclude fieldID="{A2B16B7789-7A0B-4FE6-94FD-66A9E6F8BD08}" note="'Home Link' field on the Navigation template" key="HomeLink" /> |
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
<configuration name="Shared" description="Shared Unicorn Config"> | |
<predicate> | |
<include name="SharedPageLayouts" database="master" path="/sitecore/layout/Layouts/Shared" /> | |
<include name="SharedTemplates" database="master" path="/sitecore/templates/Shared" /> | |
<!--exclude the Navigation 'Home Link' field using Field Transforms--> | |
<include name="SharedNavigation" database="master" path="/sitecore/content/Shared/Navigation" fieldTransforms="-Home Link"> | |
</predicate> | |
<dataProviderConfiguration enableTransparentSync="false" /> |
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 Scaffold-Component-And-Folder([string]$componentName, [string]$componentPath){ | |
###create component template### | |
$componentItem = New-Item -Path $componentPath -Name $componentName -ItemType "/sitecore/templates/System/Templates/Template" | |
$componentItem.Editing.BeginEdit() | |
#set default component icon | |
$componentItem["__Icon"] = "/~/icon/software/32x32/component.png"; | |
$componentItem.Editing.EndEdit() | |
Write-Host "Component Created: " $componentItem.Name |
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 Scaffold-View-Rendering([string]$renderingName, [string]$renderingPath, [string]$viewPath, [string]$dataSourcePath, [string]$dataSourceTemplate){ | |
###create rendering### | |
$renderingItem = New-Item -Path $renderingPath -Name $renderingName -ItemType "/sitecore/templates/System/Layout/Renderings/View rendering" | |
$renderingItem.Editing.BeginEdit(); | |
#set path | |
$renderingItem["Path"] = $viewPath; | |
#set default rendering icon |
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 Create-Component-Datasource([string]$componentBasePath, [string]$templateBasePath, [string]$componentFolderName, [string]$componentName, [string]$componentFolderTemplateName, [string]$componentTemplateName){ | |
###create component folder item### | |
Write-Host "Creating component folder: $($componentBasePath)/$($componentFolderName) with template: $($templateBasePath)/$($componentFolderTemplateName)" | |
$componentFolderItem = New-Item -Path $componentBasePath -Name $componentFolderName -ItemType "$($templateBasePath)/$($componentFolderTemplateName)" | |
###create component item### | |
Write-Host "Creating component: $($componentBasePath)/$($componentFolderItem.Name)/$($componentName) with template: $($templateBasePath)/$($componentTemplateName)" | |
$componentItem = New-Item -Path "$($componentBasePath)/$($componentFolderItem.Name)" -Name $componentName -ItemType "$($templateBasePath)/$($componentTemplateName)" |
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 Copy-Page-FinalLayout-To-Template([string]$pagePath,[switch]$ResetLayout){ | |
#get the page item | |
$item = Get-Item -Path "master:$pagePath" | |
#get the final layout from the page | |
$finalLayoutField = New-Object -TypeName "Sitecore.Data.Fields.LayoutField" -ArgumentList $Item.Fields[[Sitecore.FieldIDs]::FinalLayoutField] | |
if ($finalLayoutField -eq $null) { | |
Write-Error "Couldn't find final layout on: $($Item.Name)" | |
} |
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
$templateIds = | |
'{565F2D63-1359-726C-AB77-F3DA34C90AD0}', | |
'{3465B346-3B37-8E40-AB70-31E17F4F38H4}', | |
'{78309E9F-49A6-91C9-9DC3-73F340CE6690}' | |
$global:usingStandardValues = 0 | |
$global:notUsingStandardValues = 0 | |
$global:updateContentTypeField = $false | |
$global:fieldName = "content type" |