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.

1 comment: