Skip to main content

Posts

Filter search results by date range in Sitecore SXA Search

Hey blog viewers, Welcome to Learn Sitecore.  Sitecore SXA OOTB Search module contains many OOTB features such as search results, sort results and different filter types etc... To render the search results in a page, Search results rendering from OOTB will help. It contains the following details for the component display. Data Source : The data source template contains a single line text field. The content given in this field will be used to render when the search results are zero for specified scope. Rendering Parameter fields : In the rendering parameter fields we need to choose the following for the search component to work.  Search Signature : This field will help to map the search results to the correct rendering. If we add only one search results rendering to a page, this field can left blank but when more than one rendering of type search results added to the same page, this field shouldn't be blank. If the field left blank for both renderings, then which ever loads fir...

Remove bucket folders from page URL

 Hey blog viewers, Welcome to Learn Sitecore.  In this blog we will see how to remove bucket folders from page URL. It is the best practice for the Sitecore application to have a clean URL to meet it's SEO purposes. So let's go through how we can achieve this.  First, in order to remove the bucket folders from the URL we have to decide the URL structure we need to keep and follow for the pages stored under bucket folder. For the instance I am taking the following URL https://developersite.com/news/2022/06/17/news-1. In this URL 2022/06/17 represents the bucket folders. This structure of bucket folders can be different based on the structure that one will follow up on the requirement. After removing the bucket folders from URL, it will be https://developersite.com/news/news-1 . In order to do this we first need to build this customized URL. For that we would need to create a new link provider which overrides the GetItemUrl method present in the link providers pro...

Sitecore Power Shell Scripts

Export dictionaries into a CSV file Here we can see how to export the dictionaries data, key and phrases, into a csv file using a power shell script.  $DataPath = "Give the path of Csv file to export dictionaries data" $allItems = Get-ChildItem -Path 'master:Give the path of dictionaries parent item' -Recurse $Results = @() ForEach ($item in $allItems) {  if($item.TemplateName -eq "Dictionary Entry")    {  $LangItem = Get-Item -Path $item.FullPath -Language "Give the language code in case of secondary language data is needed. For example nl for Dutch language     $Properties = @{  ItemName = $item.Name   Key = $item["Key"]    EnglishPhrase = $item["Phrase"]  }    if($LangItem -ne $null) {        $Properties.Add("LangPhrase", $LangItem["Phrase"])   }    $Results += New-Object psobject -Property $Properties  } } $Results | Select-Object ItemName, Key, EnglishPhrase, LangPhras...