Add-PlaceholderSetting

Adds a placeholder setting to a chosen device for the presentation of an item.

Syntax

Add-PlaceholderSetting [-Item] <Item> -Instance <PlaceholderDefinition> [-MetaDataItemId <string>] [-Key <string>] [-Device <DeviceItem>] [-FinalLayout] [-Language <string[]>]

Add-PlaceholderSetting [-Path] <string> -Instance <PlaceholderDefinition> [-MetaDataItemId <string>] [-Key <string>] [-Device <DeviceItem>] [-FinalLayout] [-Language <string[]>]

Add-PlaceholderSetting -Instance <PlaceholderDefinition> -Id <string> [-MetaDataItemId <string>] [-Key <string>] [-Device <DeviceItem>] [-FinalLayout] [-Language <string[]>] [-Database <string>]

Detailed Description

Adds a placeholder setting to a chosen device for the presentation of an item.

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

Parameters

-Database <string>

Database containing the item to be processed - can work with Language parameter to narrow the publication scope.

-Device <DeviceItem>

Device the placeholder setting is assigned to. If not specified - default device will be used.

-FinalLayout <switch>

Targets the Final Layout. If not provided, the Shared Layout will be targeted. Applies to Sitecore 8.0 and higher only.

-Id <string>

Id of the item to be processed - can work with Language parameter to narrow the publication scope.

-Instance <PlaceholderDefinition>

Placeholder setting definition to be added to the item

-Item <Item>

The item to be processed.

-Key <string>

The key for this placeholder setting - if not specified the value provided in the placeholder setting definition specified in the Instance parameter will be used.

-Language <string[]>

Language that will be used as source language. If not specified the current user language will be used. Globbing/wildcard supported.

-MetaDataItemId <string>

The metadata item Id for this placeholder setting - if not specified the value provided in the placeholder setting definition specified in the Instance parameter will be used.

-Path <string>

Path to the item to be processed - can work with Language parameter to narrow the publication scope.

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.

  • System.Void

Notes

Help Author: Adam Najmanowicz, Michael West, Alex Washtell

Examples

EXAMPLE 1

Create item defining placeholder setting and add to an item

$placeholderSetting = gi "master:\layout\Placeholder Settings\content" | New-PlaceholderSetting -Key "content"
$item = gi master:\content\Home
# Add the placeholder setting to the item
Add-PlaceholderSetting -Item $item -Instance $placeholderSetting

EXAMPLE 2

Create item defining placeholder setting and add to an item, overriding the key

$placeholderSetting = gi "master:\layout\Placeholder Settings\content" | New-PlaceholderSetting -Key "content"
# find item you want the placeholder setting added to
$item = gi master:\content\Home
# Add the placeholder setting to the item
Add-PlaceholderSetting -Item $item -Instance $placeholderSetting -Key "content-override"

Last updated