Wednesday 3 August 2022

How to remove a rendering from page list using Sitecore PowerShell script ?

 There might be scenario, where 

  • remove a rendering from list of pages/Tree
  • remove broken rendering from Tree

Above we can achieve using Sitecore PowerShell script

$pageTemplateId = "{4A990Q43-71FD-4DAC-8865-5ABAAA13R911}"
$startPath = "master:/sitecore/content/YourSiteNode/Home/"
$useFinalLayout = $True
$useSharedLayout = $True
$rootItem = Get-ChildItem -Path $startPath -recurse | Where-Object { $_."TemplateID" -eq $pageTemplateId };
if($rootItem -ne $null) {
foreach($item in $rootItem) {
$renderings =  Get-Rendering -Item $item -Placeholder "/header/primary-menu" -Device (Get-LayoutDevice "Default") -FinalLayout:$useFinalLayout
foreach($rendering in $renderings) {
    $renderingItem = Get-Item -Path $rendering.ItemID
if($renderingItem.Name -eq "YourRenderingName") {
    Remove-Rendering -Item $item -Instance $rendering -Device (Get-LayoutDevice "Default") -FinalLayout:$useFinalLayout
    Write-Host $item.Name
}
}
}
}

Saturday 26 February 2022

HTTP Error 500.19 - Internal Server Error Sitecore identity server

  



If you are facing the below issue with Sitecore 9, 10, or 10.1. Then it is recommended to install the below dependency to resolve this issue.

https://dotnet.microsoft.com/download/dotnet-core/2.2

But before installation, I would suggest verifying existing .netcore in your system
by running dotnet --info on PowerShell (as admin)


Hope this will resolve your issue.



There is also another possibility for this issue that from 
Turn Windows feature on or off - choose below options


You may also face still face the same issue with Sitecore 10.2 
in that case you must be required to install as this is recommended by Sitecore https://doc.sitecore.com/xp/en/developers/102/sitecore-experience-commerce/system-requirements.html

Please go to this link to download https://dotnet.microsoft.com/download/dotnet-core/3.1

Hope the above options will help you to fix this issue.