Skip to content

Instantly share code, notes, and snippets.

@AdamNaj
Created July 7, 2014 10:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AdamNaj/feee83888cdad252338b to your computer and use it in GitHub Desktop.
Save AdamNaj/feee83888cdad252338b to your computer and use it in GitHub Desktop.
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
$items.Count
#$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*
Resolve-Error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment