Posts

Sitecore Indexing Content from different location of content tree in same index configuration file

I have to index the for some search functionality, so I don’t want to use the default index like (sitecore_master_index or sitecore_web_index) as these indexes will crawl the entire content tree irrespective of the sites in a single Sitecore instance. so, I have decided to create a custom index and crawl only specific part of Sitecore content and media library items to this index, so the performance of search will be very fast and also it will only provide contents related to the particular site only. Below is the config for the new Sitecore index. < configuration xmlns:patch = " http://www.sitecore.net/xmlconfig/ " >   < sitecore >     < contentSearch >       < configuration type = " Sitecore.ContentSearch.ContentSearchConfiguration, Sitecore.ContentSearch " >         ...

Sitecore Powershell - Creating a new sitecore multisite, Update Base Template, Renderings,Templates,Dictionary and Content

I had a requirement to create a brand-new site with same content structure (later content will be updated as per new site) based on the existing Sitecore site by duplicating all the templates and rendering and to host the site in the same Sitecore instance, Duplicating the site is very easy and hosting also done very easily but the problem is all the layout and Rendering is pointing to the old site from where we duplicated. Also, while duplicating the templates its inherited templates will still point to the old templates. So, this is the big problem as if any changes happen to the old site's templates will reflect in the new site, but we need separate templates/Rendering/Layouts for the new site. So, I thought of achieving with Sitecore Powershell scripts. Let's do it. Step 1:(Rendering Updates to new site's View and Controller) $allItems = Get-ChildItem -Path 'master:///sitecore/layout/Renderings/Projects/NewSite' -Recurse $filteredItems =$...

Creating Image Sitemap for Sitecore site

Image
I have to generate an image sitemap for multisite Sitecore application, but I can’t get any tool available online for creating unlimited pages image sitemap, So I have decided to do it programmatically. Let's do it. Step 1: Add a reference to HtmlAgilityPack.dll Step 2: Add a new Item " SitemapTest" add assign the item to use(rendering/Layout ) that we going to create in  Sitecore solution where we need to get the image sitemap. Step 3: Add the condition not to crawl this newly added view page by the code we going to do. Step 4: Add the following code for image sitemap generation in the new rendering/Layout file and add it to Sitemaptest Item.            List < Item > itemsList =  new   List < Item >();              string [] languages = {  "en" ,  "ar-ae" ,  "zh-cn" ,  "it-it" ,  "ru-ru"  };  ...