Wednesday 29 September 2021

How to get url web status in bulk ?

 In today's article, would like to present script. And the purpose of this script to Get url web status in bulk.




Recently I was chasing few issue that random pages throwing 404/500/400. So thought to prepare a script and get list of items with their current status also can be re-used after period of time.

Steps to Execute:

1. Please find script by click here

2. Please update list of urls in one file and placed at one place (Let's say D:/urls.txt)

3. Open PowerShell and execute script as .\urlhealths.ps1


Note: 

     Please do not forget to update path in script to get url list (line no. 42)

     Also please ensure urls.txt contains list of url (one url in one line)


Hope this will help.


Saturday 11 September 2021

Custom data source on Sitecore template field

 Actually there are many ways to apply data source on Template's Field, Rendering Item, Rendering data source Location and Rendering parameter. 

  • using sitecore data item path/id
  • using sitecore query/fast-query
above both - most used ways.

But there are many scenarios, where after applying data source path wanted final list after modified data by type, filtering, custom code logic or any dynamic logic on data source .


Custom class as data source
We can do this activity as well using custom class, and we can call them on 
 by setting data source Field value as

code:Sitecore.CustomDataSources.UpdateDataSource,Sitecore.CustomDataSources

custom-data-source-sitecore-template-field


PowerShell script as data source
There are also another way to do this using PowerShell script.

by setting data source value as 
script:/sitecore/system/Modules/PowerShell/Script Library/CustomDatasource

and place your PowerShell script at above location with File name as CustomDatasource



Hope this will help.