Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Import-Function Resolve-Error
#Show-FieldEditor -Item (gi master:\content\cognifidecom\int\settings) -PreserveSections -Width 500 -Height 500 -title "Zen Garden Site settings"
$content = gi master:\layout\Sublayouts\ZenGarden\Basic\Content | New-Rendering -Placeholder "main"
$item = gi master:\content\Demo\Int\Home
<#Add-Rendering -Item $item -PlaceHolder "main" -Rendering $content -Parameter @{ FieldName = "Content" }
Add-Rendering -Item $item -PlaceHolder "main" -Rendering $content -Parameter @{ FieldName = "SummaryText" }
Add-Rendering -Item $item -PlaceHolder "main" -Rendering $content -Parameter @{ FieldName = "SummaryIcon" }
#$renderings = $item | Get-Rendering -Placeholder "main"
foreach ($rendering in $Renderings)
# Remove-Rendering -Item $item -Instance $rendering
$items = gci master:\content\Demo\Int -recurse
#$item | Get-Rendering -Parameter @{ FieldName = "*ontent" } | ft *ID, place*, Param*
#Set-Rendering -item $item -PlaceHolder "main"
#$items | Get-Rendering -Parameter @{ FieldName = "*" } | ft *ID, place*, Param*
$renderings = $items | Get-Rendering -PlaceHolder "main" -Parameter @{FieldName="*ntent"} #| ft *ID, place*, Param*, OwnerItemPath -auto
$renderings | ft *ID, place*, Param*, OwnerItemPath -auto
foreach ($rendering in $renderings) {
#$rendering | ft
$rendering.Placeholder = "footer"
Set-Rendering -Item $item -Instance $rendering
#$items | ForEach-Object {[Sitecore.Layouts.LayoutDefinition]::Parse($_["__Renderings"]).Devices[0].Renderings } | ft *ID, place*, Param*
#[Sitecore.Layouts.LayoutDefinition]::Parse($item["__Renderings"]).Devices[0].Renderings | ft *ID, place*, Param*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.