Posts

Organize media files using Sitecore PowerShell

Image
Sometimes you work on project that contains big modules like "News & Media" and it contains many Media Files,   organizing Items easy using Buckets, but what about the Media files?! In this Blog Post I will provide you with a script that help you to generate media folders from 0-9 & a-z i.e. Dependencies: Sitecore powerShell The Script: The below script will help you generate Alpha Numeric Folders and move the files under those folders $alphaNumeric=@() 65..90|foreach-object{$alphaNumeric+=[char]$_} # Add the characters A-Z to the Array 48..57|foreach-object{$alphaNumeric+=[char]$_} # Add the characters 0-9 to the Array # The folder in which you want to organize the media $root = "master:/sitecore/media library/{your path}" # Generate folders based on the alpha numeric array foreach ($item in $alphaNumeric) { # Skip if the folder already ...

Set workflow for project templates using PowerShell

Image
Sitecore PowerShell is very powerful tool that helps in many kinds of tasks especially the repetitive tasks, in this blog I am sharing with you a small script that helps to add workflow to all Project templates $allItems = Get-ChildItem -path "/sitecore/templates/Project/{Your Project}" -Recurse  foreach($item in $allItems){     if($null -ne $item["__Default workflow"] -and $item.Name -eq "__Standard Values"){             Write-Host $item.Paths.FullPath             $item.Editing.BeginEdit()             $item["__Workflow"]=""             $item["__Default workflow"]="{Your Workflow ID}"             $item.Editing.EndEdit()     } }

Sitecore Desktop Shortcuts

Image
Sitecore Desktop is a fantastic tool with many capabilities, but most of us are unaware of one of them: shortcuts. In this brief blog, I aim to explain what shortcuts are and how to use them. What's Sitecore Shortcuts? In a word, Sitecore's Desktop is based on the idea of an operating system (OS) desktop, and as you may know, OS desktops have shortcut features that allow you to easily access anything, and Sitecore has the same functionality that help you to reach anything in the content editor quickly. How to make Shortcuts? Go to your Sitecore Instance Log in to  Launchpad Go to Desktop Right click >> Create shortcut Choose Link, Name and Icon Congratulations!

Deploy Config To Solr Cloud Searchstax Using Zookeper

Image
Moving to the cloud has many benefits, but for us it's a new learning curve. In this blog post I will help you deploy your Solr config set to Solr Cloud. In a nutshell, Open searchstax Repository  Download the following Files : accountdeploymentzookeeperconfigcreate.ps1: To create your config accountdeploymentzookeeperconfigdownload.ps1 : To download the config accountdeploymentzookeeperconfigdelete.ps1 : Download this file if you made any mistake and you want to delete the uploaded config set Go to Your Solr Cloud URL Go to collections >> select any of your collections to identify your default config name Download your config set using “accountdeploymentzookeeperconfigdownload.ps1” open the File in any Editor and update the below parameters: Account: it's the account name, if you are managing the searchstax account then you can get it easily Uid: This is the Deployment you can get it from the solr url, it's the first part of the url before the first Dash Name: This...

Unlock Full Rich Text Editor In Sitecore

Image
As Usual Sitecore Team not forget hidden gems, This blog will let you enable all hidden buttons in Sitecore RTE (Rich Text Editor) as per your requirements. Sitecore provide us with more than one profile in Core Database for RTE, I will show you each one with path in core Database: Profiles Path: "/sitecore/system/Settings/Html Editor Profiles" Profiles Types: There's four types of profiles for RTE  click on Images to view the full size Default IDE Medium Full How To Apply: Step 1: Create new config file Step 2: Add the following code to change the default RTE <sitecore> <settings>      <setting name="HtmlEditor.DefaultProfile" value="/sitecore/system/Settings/Html Editor Pr...

Sitecore Images ALT text

Image
As you know the Images in Sitecore uses Unversioned  template which uses the default language "en", but what if you need to use Alt Text in other languages, and you don't want to add the text for each language? I actually tried many things to do this 😰 my first solution was to make custom processor for uploading images and control the whole process, but this not worked for me as I was uploading images with alternative text from Item not from Media Library, unfortunately this not worked for me as the alt text was empty when uploading the images I made too much debugging to know Why!! and also did a reverse engineering on Sitecore.Kernel.dll through ILSpy  but nothing useful to me Then I tried to take a look at the templates of the Images, I found that all fields is Shared except the alt text and I remembered that all fields were filled with data while debugging except the alt Field Th...

Hidden things about Constructor in C#

Image
  What's constructor? It's a special method used to initialize an object or struct, limit access to object or control object or structs by set default values, In brief it's like the key to the door, let's say you want to run your car what do you need to do this? of sure you need the Key to run, so the Constructor in this case to run function of the Car has a Parameter called Key, without the Key you cannot run public class Car { string _key; public Car(string key){ // the constructor, accepts string key as parameter _key=key; } } Parameterless constructors: If you didn't create any constructors in your class, then C# creates the default P arameterless Constructor that initialize C# types default values, and the same on Structs, and if you have Static Fields then C# by default creates Static Constructor to initialize those Fields into default value   ...