Get-Rendering
Returns a RenderingDefinition for an item using the filtering parameters.

Syntax

1
Get-Rendering -Item <Item> [-DataSource <String>] [-Rendering <Item>] [-Index <Int32>] [-PlaceHolder <String>] [-Parameter <Hashtable>] [-Device <DeviceItem>] [-FinalLayout] [-Language <String[]>]
2
​
3
Get-Rendering -Item <Item> -Instance <RenderingDefinition> [-Device <DeviceItem>] [-FinalLayout] [-Language <String[]>]
4
​
5
Get-Rendering -Item <Item> -UniqueId <String> [-Device <DeviceItem>] [-FinalLayout] [-Language <String[]>]
6
​
7
Get-Rendering -Path <String> [-DataSource <String>] [-Rendering <Item>] [-Index <Int32>] [-PlaceHolder <String>] [-Parameter <Hashtable>] [-Device <DeviceItem>] [-FinalLayout] [-Language <String[]>]
8
​
9
Get-Rendering -Path <String> -Instance <RenderingDefinition> [-Device <DeviceItem>] [-FinalLayout] [-Language <String[]>]
10
​
11
Get-Rendering -Path <String> -UniqueId <String> [-Device <DeviceItem>] [-FinalLayout] [-Language <String[]>]
12
​
13
Get-Rendering [-Id <String>] [-Database <String>] [-DataSource <String>] [-Rendering <Item>] [-Index <Int32>] [-PlaceHolder <String>] [-Parameter <Hashtable>] [-Device <DeviceItem>] [-FinalLayout] [-Language <String[]>]
14
​
15
Get-Rendering [-Id <String>] [-Database <String>] -Instance <RenderingDefinition> [-Device <DeviceItem>] [-FinalLayout] [-Language <String[]>]
16
​
17
Get-Rendering [-Id <String>] [-Database <String>] -UniqueId <String> [-Device <DeviceItem>] [-FinalLayout] [-Language <String[]>]
Copied!

Detailed Description

The Get-Rendering command returns a RenderingDefinition for an item using the filtering parameters.
© 2010-2019 Adam Najmanowicz, Michael West. All rights reserved. Sitecore PowerShell Extensions

Parameters

-Item <Item>

The item to be processed.
Aliases
Text
Required?
true
Position?
named
Default Value
​
Accept Pipeline Input?
true (ByValue, ByPropertyName)
Accept Wildcard Characters?
false

-Path <String>

Path to the item to be processed - can work with Language parameter to narrow the publication scope.
Aliases
Text
Required?
true
Position?
named
Default Value
​
Accept Pipeline Input?
false
Accept Wildcard Characters?
false

-Id <String>

Id of the item to be processed - can work with Language parameter to narrow the publication scope.
Aliases
Text
Required?
false
Position?
named
Default Value
​
Accept Pipeline Input?
false
Accept Wildcard Characters?
false

-Database <String>

Database containing the item to be processed - can work with Language parameter to narrow the publication scope.
Aliases
Text
Required?
false
Position?
named
Default Value
​
Accept Pipeline Input?
false
Accept Wildcard Characters?
false

-DataSource <String>

Data source filter - supports wildcards.
Aliases
Text
Required?
false
Position?
named
Default Value
​
Accept Pipeline Input?
false
Accept Wildcard Characters?
false

-Rendering <Item>

Item representing the sublayout/rendering. If matching the rendering will be returned.
Aliases
Text
Required?
false
Position?
named
Default Value
​
Accept Pipeline Input?
false
Accept Wildcard Characters?
false

-Index <Int32>

Index at which the rendering exists in the layout. The rendering at that index will be returned.
Aliases
Text
Required?
false
Position?
named
Default Value
​
Accept Pipeline Input?
false
Accept Wildcard Characters?
false

-PlaceHolder <String>

Place holder at which the rendering exists in the layout. Renderings at that place holder will be returned.
Aliases
Text
Required?
false
Position?
named
Default Value
​
Accept Pipeline Input?
false
Accept Wildcard Characters?
false

-Parameter <Hashtable>

Additional rendering parameter values. If both name and value match - the rendering will be returned. Values support wildcards.
Aliases
Text
Required?
false
Position?
named
Default Value
​
Accept Pipeline Input?
false
Accept Wildcard Characters?
false

-Instance <RenderingDefinition>

Specific instance of rendering that should be returned. The instance could earlier be obtained through e.g. use of Get-Rendering.
Aliases
Text
Required?
true
Position?
named
Default Value
​
Accept Pipeline Input?
false
Accept Wildcard Characters?
false

-UniqueId <String>

UniqueID of the rendering to be retrieved.
Aliases
Text
Required?
true
Position?
named
Default Value
​
Accept Pipeline Input?
false
Accept Wildcard Characters?
false

-Device <DeviceItem>

Device for which the renderings will be retrieved.
Aliases
Text
Required?
false
Position?
named
Default Value
​
Accept Pipeline Input?
false
Accept Wildcard Characters?
false

-FinalLayout <SwitchParameter>

Targets the Final Layout. If not provided, the Shared Layout will be targeted. Applies to Sitecore 8.0 and higher only.
Aliases
Text
Required?
false
Position?
named
Default Value
​
Accept Pipeline Input?
false
Accept Wildcard Characters?
false

-Language <String[]>

Aliases
Text
Required?
false
Position?
named
Default Value
​
Accept Pipeline Input?
false
Accept Wildcard Characters?
false

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.
  • Sitecore.Data.Items.Item

Outputs

The output type is the type of the objects that the cmdlet emits.
  • Sitecore.Layouts.RenderingDefinition

Notes

Help Author: Adam Najmanowicz, Michael West

Examples

EXAMPLE 1

Get all renderings for "Default" device, located in the any placeholder that has name in it or any of its sub-placeholders.
1
Get-Item master:\content\home |
2
Get-Rendering -Placeholder "*main*" -Device (Get-LayoutDevice "Default")
Copied!

EXAMPLE 2

The following example returns all renderings on the home page.
1
$item = Get-Item -Path "master:" -ID "{110D559F-DEA5-42EA-9C1C-8A5DF7E70EF9}"
2
$defaultLayout = Get-LayoutDevice "Default"
3
Get-Rendering -Item $item -Device $defaultLayout -FinalLayout
Copied!

Related Topics