New-Rendering

Last updated last month

Creates new rendering definition that can later be added to an item.

Syntax

New-Rendering [-Item] <Item> [-Parameter <Hashtable>] [-PlaceHolder <String>] [-DataSource <Item>] [-Cacheable] [-VaryByData] [-VaryByDevice] [-VaryByLogin] [-VaryByParameters] [-VaryByQueryString] [-VaryByUser] [-Language <String[]>]

New-Rendering [-Path] <String> [-Parameter <Hashtable>] [-PlaceHolder <String>] [-DataSource <Item>] [-Cacheable] [-VaryByData] [-VaryByDevice] [-VaryByLogin] [-VaryByParameters] [-VaryByQueryString] [-VaryByUser] [-Language <String[]>]

New-Rendering -Id <String> [-Database <String>] [-Parameter <Hashtable>] [-PlaceHolder <String>] [-DataSource <Item>] [-Cacheable] [-VaryByData] [-VaryByDevice] [-VaryByLogin] [-VaryByParameters] [-VaryByQueryString] [-VaryByUser] [-Language <String[]>]

Detailed Description

Creates new rendering definition that can later be added to an item. Most parameters can later be overriden when calling Add-Rendering.

© 2010-2017 Adam Najmanowicz, Michael West. All rights reserved. Sitecore PowerShell Extensions

Parameters

-Parameter <Hashtable>

Rendering parameters as hashtable

Aliases

Required?

false

Position?

named

Default Value

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-PlaceHolder <String>

Placeholder for the rendering to be placed into.

Aliases

Required?

false

Position?

named

Default Value

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-DataSource <Item>

Datasource for the rendering.

Aliases

Required?

false

Position?

named

Default Value

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Cacheable <SwitchParameter>

Defined whether the rendering is cacheable.

Aliases

Required?

false

Position?

named

Default Value

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VaryByData <SwitchParameter>

Defines whether a data-specific cache version of the rendering should be kept.

Aliases

Required?

false

Position?

named

Default Value

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VaryByDevice <SwitchParameter>

Defines whether a device-specific cache version of the rendering should be kept.

Aliases

Required?

false

Position?

named

Default Value

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VaryByLogin <SwitchParameter>

Defines whether a login - specific cache version of the rendering should be kept.

Aliases

Required?

false

Position?

named

Default Value

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VaryByParameters <SwitchParameter>

Defines whether paremeter - specific cache version of the rendering should be kept.

Aliases

Required?

false

Position?

named

Default Value

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VaryByQueryString <SwitchParameter>

Defines whether query string - specific cache version of the rendering should be kept.

Aliases

Required?

false

Position?

named

Default Value

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VaryByUser <SwitchParameter>

Defines whether a user - specific cache version of the rendering should be kept.

Aliases

Required?

false

Position?

named

Default Value

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Language <String[]>

Aliases

Required?

false

Position?

named

Default Value

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Item <Item>

The item to be processed.

Aliases

Required?

true

Position?

1

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

Required?

true

Position?

1

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

Required?

true

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

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.RenderingDefinitio

Notes

Help Author: Adam Najmanowicz, Michael West

Examples

EXAMPLE

find item defining rendering and create rendering definitio

PS master:\> $renderingItem = gi master:\layout\Sublayouts\ZenGarden\Basic\Content | New-Rendering -Placeholder "main"
# find item you want the rendering added to
PS master:\> $item = gi master:\content\Demo\Int\Home
# Add the rendering to the item
PS master:\> Add-Rendering -Item $item -PlaceHolder "main" -Rendering $renderingItem -Parameter @{ FieldName = "Content" }

Related Topics