This file contains hidden or 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
<# | |
.SYNOPSIS | |
Download a page and parse Sitecore debug comments into a JSON hierarchy. | |
.DESCRIPTION | |
Scans a Sitecore-rendered HTML page for <!-- start-component='…' --> and <!-- end-component='…' --> | |
markers, extracts metadata (name, id, uid, placeholder, path), and reconstructs a nested | |
component-to-placeholder tree. Strict UID matching ensures proper pairing of start/end tags, | |
while allowing the root layout to remain on the stack at the end. |
This file contains hidden or 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
<# | |
.SYNOPSIS | |
Lists every item (and its template's Standard Values) that actually has | |
presentation details (shared and/or final layouts) beneath a chosen site root. | |
.PARAMETER SiteRoot | |
The content path to start from. Defaults to "/sitecore/content/Zont/Habitat/Home". | |
.PARAMETER DatabaseName | |
The Sitecore database to query (master/web/old/etc.). Defaults to "master". |
This file contains hidden or 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
param( | |
[string] $PlaceholderKey = "col-wide-2" | |
) | |
# 1) Load master database | |
$db = [Sitecore.Configuration.Factory]::GetDatabase("master") | |
if (-not $db) { | |
Write-Error "ERROR: Could not load the 'master' database." | |
exit 1 | |
} |
This file contains hidden or 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
Set-Location -Path $PSScriptRoot | |
# Load connection settings | |
$config = Get-Content -Raw -Path ./config.LOCAL.json | ConvertFrom-Json | |
# Import SPE and start a remote session | |
Import-Module -Name SPE | |
$session = New-ScriptSession -ConnectionUri $config.connectionUri ` | |
-Username $config.username ` | |
-SharedSecret $config.SPE_REMOTING_SECRET |
This file contains hidden or 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
$ErrorActionPreference = 'Stop' | |
# ❶ Mount master: drive if absent | |
if (-not (Get-PSDrive -Name master -ErrorAction SilentlyContinue)) { | |
New-PSDrive -Name master -PSProvider Sitecore -Root "/" -Database "master" -ErrorAction Stop | Out-Null | |
} | |
# ❷ Get master database | |
$db = [Sitecore.Configuration.Factory]::GetDatabase('master') | |
if (-not $db) { throw 'Cannot get master database.' } |
This file contains hidden or 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
param( | |
[string]$ParametersTemplateId = "{A2A233A1-6701-48A9-B5F8-EFEAB74B655F}" | |
) | |
$ErrorActionPreference = "Stop" | |
# 1. Mount master drive if needed | |
if (-not (Get-PSDrive -Name master -ErrorAction SilentlyContinue)) { | |
New-PSDrive -Name master -PSProvider Sitecore -Root "/" -Database "master" -ErrorAction Stop | Out-Null | |
} |
This file contains hidden or 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
<# | |
.SYNOPSIS | |
Slices a fully rendered Sitecore HTML page into individual Next.js component `.tsx` files, | |
based on the <!-- start-component='…' --> / <!-- end-component='…' --> markers and | |
by calling Get-Layout.ps1 (which now returns JSON) for the layout hierarchy. | |
.PARAMETER Url | |
The URL of the rendered page. Defaults to http://rssbplatform.dev.local/aaa | |
.PARAMETER ItemPath |
This file contains hidden or 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
param( | |
[string]$itemPath = "/sitecore/content/Zont/Habitat/Home/AAA" | |
) | |
Set-Location -Path $PSScriptRoot | |
$config = Get-Content -Raw -Path ./config.LOCAL.json | ConvertFrom-Json | |
# Write-Output "ConnectionUri: $($config.connectionUri)" | |
# Write-Output "Username : $($config.username)" | |
# Write-Output "SPE Remoting Secret : $($config.SPE_REMOTING_SECRET)" |
This file contains hidden or 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
# ----------------------------------------------- | |
# Script: Get-FinalLayoutXml-ForPage.ps1 | |
# Purpose: Retrieve the merged (“Final”) layout XML | |
# for a given page item—combining shared, | |
# versioned, and standard-values presentations. | |
# Target Item: /sitecore/content/Zont/Habitat/Home/AAA | |
# Prerequisites: Run inside Sitecore PowerShell ISE or | |
# using Sitecore PowerShell Extensions context. | |
# ----------------------------------------------- |
This file contains hidden or 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
# ----------------------------------------------------------- | |
# Inline Script for Sitecore PowerShell ISE: | |
# Replace Multiple Placeholders for Renderings | |
# Target Item: Default is /sitecore/content/Zont/Habitat/Home/AAA | |
# DB: master | |
# - Processes Standard Values, Shared Layout, and Final Layout. | |
# - Replaces three placeholder pairs: | |
# $OldPlaceholder1 → $NewPlaceholder1 | |
# $OldPlaceholder2 → $NewPlaceholder2 | |
# $OldPlaceholder3 → $NewPlaceholder3 |
NewerOlder