Get-ItemTemplate
Returns the item template and its base templates.

Syntax

Get-ItemTemplate [-Item] <Item> [-Recurse]
Get-ItemTemplate [-Path] <String> [-Recurse]
Get-ItemTemplate -Id <String> [-Database <String>] [-Recurse]

Detailed Description

The Get-ItemTemplate command returns the item template and its base templates.
© 2010-2019 Adam Najmanowicz, Michael West. All rights reserved. Sitecore PowerShell Extensions

Parameters

-Recurse <SwitchParameter>

Return the template the item is based on and all of its base templates.
Aliases
Text
Required?
false
Position?
named
Default Value
Accept Pipeline Input?
false
Accept Wildcard Characters?
false

-Item <Item>

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

-Path <String>

Path to the item to be analysed.
Aliases
Text
Required?
true
Position?
1
Default Value
Accept Pipeline Input?
false
Accept Wildcard Characters?
false

-Id <String>

Id of the item to be analysed.
Aliases
Text
Required?
true
Position?
named
Default Value
Accept Pipeline Input?
false
Accept Wildcard Characters?
false

-Database <String>

Database containing the item to be analysed - required if item is specified with Id.
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.Data.Items.TemplateItem

Notes

Help Author: Adam Najmanowicz, Michael West

Examples

EXAMPLE 1

Get template of /sitecore/conent/home item
1
PS master:\> Get-ItemTemplate -Path master:\content\home
2
3
BaseTemplates : {Standard template}
4
Fields : {__Context Menu, __Display name, __Editor, __Editors...}
5
FullName : Sample/Sample Item
6
Key : sample item
7
OwnFields : {Title, Text, Image, State...}
8
StandardValues : Sitecore.Data.Items.Item
9
Database : master
10
DisplayName : Sample Item
11
Icon : Applications/16x16/document.png
12
ID : {76036F5E-CBCE-46D1-AF0A-4143F9B557AA}
13
InnerItem : Sitecore.Data.Items.Item
14
Name : Sample Item
Copied!

EXAMPLE 2

Get template of /sitecore/conent/home item and all of the templates its template is based on then format it to only show the template name, path and Key
1
PS master:\> Get-Item -Path master:/content/Home | Get-ItemTemplate -Recurse | ft Name, FullName, Key -auto
2
3
Name FullName Key
4
---- -------- ---
5
Sample Item Sample/Sample Item sample item
6
Standard template System/Templates/Standard template standard template
7
Advanced System/Templates/Sections/Advanced advanced
8
Appearance System/Templates/Sections/Appearance appearance
9
Help System/Templates/Sections/Help help
10
Layout System/Templates/Sections/Layout layout
11
Lifetime System/Templates/Sections/Lifetime lifetime
12
Insert Options System/Templates/Sections/Insert Options insert options
13
Publishing System/Templates/Sections/Publishing publishing
14
Security System/Templates/Sections/Security security
15
Statistics System/Templates/Sections/Statistics statistics
16
Tasks System/Templates/Sections/Tasks tasks
17
Validators System/Templates/Sections/Validators validators
18
Workflow System/Templates/Sections/Workflow workflow
Copied!

Related Topics