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
# Create Package & Set Properties | |
$package = new-package "Test Pages & Components"; | |
$package.Sources.Clear(); | |
$package.Metadata.Author = "aseabridge"; | |
$package.Metadata.Publisher = "Flux Digital"; | |
$package.Metadata.Version = "1.0"; | |
$package.Metadata.Readme = 'This package contains number of test pages and components'; | |
Write-Host "Creating Test Pages & Components Package..." |
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
New-Item -Path "master:\content\home" -Name "Item With Forced ID" -ItemType "Sample/Sample Item" -ForceId "777f5e27-bbb2-462b-a3bc-8e170e84649d" | |
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
#add captcha to any form that doesn't have one already | |
$formsRootPath = "master:/sitecore/content/Wbsite1/forms/test" | |
$wffmFormTemplateId = "{FFB1DA32-2764-47DB-83B0-95B843546A7E}" | |
$wffmFieldTemplateId = "{C9E1BF85-800A-4247-A3A3-C3F5DFBFD6AA}" | |
$captchaFieldTemplateId = "{7FB270BE-FEFC-49C3-8CB4-947878C099E5}" | |
$captchaFieldName = "I'm not a Robot" | |
$captchFieldSortOrder = 1000 | |
$updatedCount = 0 | |
Write-Host "Getting List of Forms to add Captchas to from: $($formsRootPath)..." |
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" |
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
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 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 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
<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" /> |