-
-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Nick's blog added to sample scripts: http://www.techphoria414.com/Blo…
…g/2012/September/Use_Sitecore_Powershell_to_Find_Templates_with_Layout Text results shows the text properly formatted with colors now. Output.ToString no longer adds additional line terminations.
- Loading branch information
Showing
4 changed files
with
111 additions
and
13 deletions.
There are no files selected for viewing
72 changes: 72 additions & 0 deletions
72
...werShell/Script Library/Examples/Content interrogation/Find templates using a layout.item
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
----item---- | ||
version: 1 | ||
id: {7CC5F576-FA33-4773-B94E-22DC9CEEAB8D} | ||
database: master | ||
path: /sitecore/system/Modules/PowerShell/Script Library/Examples/Content interrogation/Find templates using a layout | ||
parent: {9BCCA568-A261-4681-85EB-C74D513736EF} | ||
name: Find templates using a layout | ||
master: {00000000-0000-0000-0000-000000000000} | ||
template: {DD22F1B3-BD87-4DB2-9E7D-F7A496888D43} | ||
templatekey: PowerShell Script | ||
|
||
----version---- | ||
language: en | ||
version: 1 | ||
revision: 6ce9c51f-cdcf-4079-91d2-ada751dee5b6 | ||
|
||
----field---- | ||
field: {B1A94FF0-6897-47C0-9C51-AA6ACB80B1F0} | ||
name: Script | ||
key: script | ||
content-length: 967 | ||
|
||
<# | ||
Based on Blog by @Techphoria414 - Nick Wesselman | ||
http://www.techphoria414.com/Blog/2012/September/Use_Sitecore_Powershell_to_Find_Templates_with_Layout | ||
#> | ||
|
||
$layout = get-item "master:\layout\Layouts\Sample Layout\" | ||
$result = Read-Variable -Parameters ` | ||
@{ Name = "layout"; Title="Layout"; Root="/sitecore/layout/Layouts/"; Tooltip="Layout you want to find."} ` | ||
-Description "This report will analyse the templates and show you all the templates that use the Layout you choose in this dialog" ` | ||
-Title "Layout Usage" -Width 500 -Height 400 ` | ||
-OkButtonName "Find" -CancelButtonName "Abort" | ||
|
||
if($result -ne "ok") | ||
{ | ||
Exit | ||
} | ||
|
||
$linkDatabase = [Sitecore.Globals]::LinkDatabase | ||
$links = $linkDatabase.GetReferrers($layout) | ||
$links | foreach-object { if ($_.GetSourceItem() -and $_.GetSourceItem().Paths.Path.ToLower().StartsWith("/sitecore/templates")) { write-host $_.GetSourceItem().Paths.Path } } | ||
Show-Result -Text -Width 800 -Height 700 | ||
Close-Window | ||
----field---- | ||
field: {25BED78C-4957-4165-998A-CA1B52F67497} | ||
name: __Created | ||
key: __created | ||
content-length: 15 | ||
|
||
20130902T101027 | ||
----field---- | ||
field: {8CDC337E-A112-42FB-BBB4-4143751E123F} | ||
name: __Revision | ||
key: __revision | ||
content-length: 36 | ||
|
||
6ce9c51f-cdcf-4079-91d2-ada751dee5b6 | ||
----field---- | ||
field: {D9CF14B1-FA16-4BA6-9288-E8A174D4D522} | ||
name: __Updated | ||
key: __updated | ||
content-length: 34 | ||
|
||
20130902T101932:635137139728065625 | ||
----field---- | ||
field: {BADD9CF9-53E0-4D0C-BCC0-2D784C282F6A} | ||
name: __Updated by | ||
key: __updated by | ||
content-length: 14 | ||
|
||
sitecore\admin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters