# New-Rendering

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

## Syntax

```powershell
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-2019 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.RenderingDefinition

## Notes

Help Author: Adam Najmanowicz, Michael West

## Examples

### EXAMPLE 1

Find item defining rendering and create rendering definition.

```powershell
# Find the rendering item and convert to a rendering
$renderingPath = "/sitecore/layout/Renderings/Feature/Experience Accelerator/Page Content/Page Content"
$renderingItem = Get-Item -Database "master" -Path $renderingPath | New-Rendering -Placeholder "main"
# Find the item to receive the new rendering
$item = Get-Item -Path "master:\content\Training\Playground\play1\Home"
# Add the rendering to the item
Add-Rendering -Item $item -PlaceHolder "main" -Instance $renderingItem -Parameter @{ "Reset Caching Options" = "1" } -FinalLayout
```

## Related Topics

* <https://github.com/SitecorePowerShell/Console/>
* [Add-Rendering](/appendix/presentation/add-rendering.md)
* [Set-Rendering](/appendix/presentation/set-rendering.md)
* [Get-Rendering](/appendix/presentation/get-rendering.md)
* [Get-LayoutDevice](/appendix/presentation/get-layoutdevice.md)
* [Remove-Rendering](/appendix/presentation/remove-rendering.md)
* [Get-Layout](/appendix/presentation/get-layout.md)
* [Set-Layout](/appendix/presentation/set-layout.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.sitecorepowershell.com/appendix/presentation/new-rendering.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
