Monday, 30 November 2015

Force Download of PDF in Sitecore

Make sure to have ForceDownload as true and disable the Range Retrival using below setting if needed.

<mediaType name="PDF file" extensions="pdf">  

<setting name="Media.EnableRangeRetrievalRequest" value="false"/>

Friday, 27 November 2015

Can we do swap of CORE for Given Sitecore Index

Yes we can have two cores for given sitecore index and can be swapped..

When Sitecore is configured to use 2 cores for particular index, it will use the primary one for retrieving search results. Every time you execute rebuild of the index, secondary core will be rebuilt and after the rebuild, cores will be switched - the rebuilt core will become new primary core, and the old primary core will become secondary core now.

Please refer the below url in order to have detailed understanding of the same.

Thursday, 19 November 2015

Alias not working when changed

How to check Alias is active 


How to check if alias exist

Database database = Context.Database;  

Monday, 16 November 2015

Descendant and Ancestor axes are disabled. Set FastQueryDescendantsDisabled setting to false to enable these axes.

Suddenly this morning I started getting error

Descendant and Ancestor axes are disabled. Set FastQueryDescendantsDisabled setting to false to enable these axes.

When researched found there is a setting in web.config 

           Determines whether ability to select items through Ancestors/Descendants axes should be disabled in fast query.
           Default value: false
      <setting name="FastQueryDescendantsDisabled" value="false" />

Surprised that this setting has not been changed ; to invetigate further i searched FastQueryDescendantsDisabled invetigate whole root solution folder..

Then I found one more place where it was true..changed and life back to normal,


Please note 

As per sitecore fast query cheat sheet whenever we change this we should clean up the databases.

If the FastQueryDescendantsDisabled setting, in the web.config file, is set to true and then changed back
to false, you must rebuild the Descendents table.
To rebuild the Descendents table, click Sitecore, Control Panel, Databases, Clean Up Database and run
the Clean Up Database wizard.

Monday, 2 November 2015

How to add additional information on Sitecore Login Page

getAboutInformation pipeline can be order to display custom information on login page.

Thursday, 29 October 2015

How to remove item's Workflow& WorkflowState programmatically?

using ( new SecurityDisabler() )

Item["__workflow"] = string.Empty;
Item["__workflow state"] = string.Empty;
Item["__lock"] = "<r />";
Item["__default workflow"] = string.Empty;


Wednesday, 28 October 2015

How to get The Home Item of the Context Site

Sitecore.Sites.SiteContext contextSite = Sitecore.Context.Site; Sitecore.Data.Items.Item home = Sitecore.Context.Database.GetItem(contextSite.StartPath);

How to compare two table data in sql server

 SELECT * FROM tbl_NewData

 SELECT * FROM tbl_OldData  

Import Data from excel Sheet

 EXEC sp_configure 'Show Advanced Options', 1

EXEC sp_configure 'Ad Hoc Distributed Queries', 1

EXEC sp_MSSet_oledb_prop N'Microsoft.ACE.OLEDB.12.0', N'AllowInProcess', 1

EXEC sp_MSSet_oledb_prop N'Microsoft.ACE.OLEDB.12.0', N'DynamicParameters', 1


select * FROM   OPENROWSET('Microsoft.ACE.OLEDB.12.0',
'Excel 12.0 Xml;HDR=YES;Database=D:\DataMigrationFiles\New Data.xlsx',
'SELECT * FROM [Sheet2$]')

Please note we need to run the SSMS with Super user.

Tuesday, 20 October 2015

How to disable the Remember me checkbox on the login page

            If true, Sitecore disables the "Remember me" checkbox on the login page.
            Default: false
      <setting name="Login.DisableRememberMe" value="true" />

How can we Turn off Auto Complete of Username in the Login Page

            If true, an autocomplete="off" attribute is added on the Sitecore login forms on the /sitecore/login/default.aspx and 
            /sitecore/admin/login.aspx pages. This is useful, for example, if you don't want user names to be disclosed when editors
            log into Sitecore on shared/public computers.
            Default value: false
      <setting name="Login.DisableAutoComplete" value="false" />

How to prevent Cross-Frame Scripting

        <add name="X-Frame-Options" value="SAMEORIGIN" />

Can we encrypt the connection string in sitecore

Custom item url for Item Bucketing

Monday, 19 October 2015

how to not index all sitecore item in sitecore search

There is setting called Root in Index Definition in "Sitecore.ContentSearch.Solr.Indexes.config"

Here we can mentioned the root of our site to exclude the unwanted index..


Monday, 5 October 2015

Why not to use Sitecore Internal Links as Field Type in Sitecore Data Template

internal Links store references by item path rather then ID..That why we should not use Internal Links.
Use drop tree as back up.

Wednesday, 9 September 2015

Sitecore Gutter

We can have custom gutter can use this in order to write custom validatios..

Tuesday, 8 September 2015

Sitecore Rich Text Not Working

We were getting javascript error while adding data on Sitecore Rich text editor.

The issue was content was not good.

Wednesday, 2 September 2015

Developer Assistant

Developer Assistant puts millions of code snippets and code sample projects at your fingertips while you are coding in Visual Studio.

Thursday, 13 August 2015

How can I ensure the rendering Properties is always opened when I add rendering to Item

The "Open Properties After Add" field allows you to choose if the component properties (datasource, caching, params etc.) windows will be opened automatically when a content editor adds a sublayout to a page. It has values of "Default", "Yes" and "No".

How Can I export Mime Types from One machine to other Machine

 The Mime type are stored on below files.. Copy Paste from one machine to other may help



Wednesday, 12 August 2015

Viewstate uses which classes in order to save control state

Manages the view state of ASP.NET server controls, including pages. This class cannot be inherited.


Is duration compulsary in OutputCache

If you will not pass you will get Run time parser error..
 [OutputCache( VaryByParam = "None")]
Will Throw run time error... 

Tuesday, 11 August 2015

How to disable Indexing in sitecore

<setting name="Indexing.Enabled" value="false" />

Sitecore.Configuration.Settings.Indexing.Enabled = false;
This is used in sitecore as
            public static bool Enabled
                    return Settings.Indexing.enabled;
                    Settings.Indexing.enabled = value;
    // How to pause indexing in Sitecore 7.0 Update-1 (rev130810) and later
    // Do a lot of item updates
    // Enable indexing again. Might be a good idea to also rebuild all indexes.

Thursday, 6 August 2015

Image compression using Dianoga

I installed using Nuget

PM> Install-Package Dianoga

Thursday, 30 July 2015

Fast Query Observation

  • Sorting is not allowed
  • Fast Query does not support Functions 
  • Fast query does not search standard values
  • Fast query does not support subquery 
  • ; is seperator for multiple query
  • Sitecore query is case-sensitive in value comparisons, but not item and field name comparisons
  • Fast query does not account for the context language (results include items with versions that match the query in any language)
  • FastQueryDescendantsDisabled Setting needs to be checked if feel result not matching as per your need.
  • fast: query became obsolete with the introduction of Sitecore ContentSearch in versions 7 and above
  • fast query  doesn't scale at all. We are putting all load onto  SQL servers running the query, bypassing all the advanced caching, indexing and so on that Sitecore has to offer.

How to redirect Permanent to given Url

   private void RedirectPermanent(string url)
            HttpContext current = HttpContext.Current;
            current.Response.StatusCode = 301;
            current.Response.RedirectLocation = url;
            current.Response.AddHeader("X-SFUM-Redirect", "true");

Friday, 17 July 2015

How to clear all values in dropdown

var ddl = document.getElementById("ddlKey");



The JSON.stringify() method converts a JavaScript value to a JSON string..

Tuesday, 14 July 2015

Tuesday, 30 June 2015

What is the Maximum Limit for Sitecore Item

The maximum length of an item name is configurable and by default it is set as 100.

      <!--  MAX ITEM NAME
            Specifies the maximum length of an item name.
            Default value: 100
      <setting name="MaxItemNameLength" value="100" />

Friday, 26 June 2015

Sitecore query analyzer in returning wrong Count

I was trying to get count of number of subitems within my ItemPath using below query select count(ItemPath/* ) but this query is returning always 500 though the number of items
select count(ItemPath/* ) but this query is returning always 500 though the number of items
Sitecore climber  suggest to check below properties 

   <!--  Query.MaxItems
            Specifies the max number of items in a query result set.
            If the number is 0, all items are returned. This may affect system performance, if a
            large query result is returned.
            This also controls the number of items in Lookup, Multilist and Valuelookup fields.
            Default value: 100
      <setting name="Query.MaxItems" value="500" />

It worked

Monday, 22 June 2015

Delete Sub Items Sitecore

All you have to do is click on the parent item and  then click on the Home tab in the Ribbon, and then click on the Delete drop-down in the Operations 

You can also Use Sitecore Rocks & Select Multiple item using ctrl

We can also use Sitecore Query Analyzer

                    Delete  From /sitecore/content/.../ItemTobedeleted/*

What about using Powershell Module.  :) 

Friday, 19 June 2015

Sitecore Query :: How to Handle Field with Space

select @#FIELD NAME# from /sitecore/content/Home

Assign value to Multilist Field to given sitecore item

                                MultilistField mf = myitem.Fields["Field Name"];
                              string query = String.Format(CultureInfo.InvariantCulture, "fast:/sitecore/content/....//*[@Name='{0}']", searchText);

                                            Item reference = master.SelectSingleItem(query);
                                            if (reference != null)

Assign the DateTime Field Using Sitecore API

var date = Datetime.Now;
                                if (!string.IsNullOrEmpty(date))
                                    var dateTime = DateTime.Parse(date, CultureInfo.InvariantCulture);
                                    var isoDate = DateUtil.ToIsoDate(dateTime);
                                    Item["Date"] = isoDate;

More Info

Tuesday, 16 June 2015

Remove ~ from media url sitecore

As said IIS need some elevated privileges in order to cater

 /~/media prefix 

So we remove this by below line of code.

<configuration xmlns:patch="">
      <setting name="Media.MediaLinkPrefix">
        <patch:attribute name="value">-/media</patch:attribute>
      <handler trigger="-/media/" handler="sitecore_media.ashx"/>

Disable the Upload watcher sitecore

Upload watcher automatically creates items in the Media section for files in /Website/upload folder, which may present a security risk if this functionality is not used.

Disabling Upload watcher  ensures that you can only upload files from within the Sitecore client and have control over the files that are uploaded  

When Upload Watcher is disabled, files that are placed in the /upload folder are not automatically
uploaded to the Media Library

 <remove name="ScriptModule"/>
 <add type="Sitecore.Nexus.Web.HttpModule,Sitecore.Nexus" name="SitecoreHttpModule"/>
 <add type="Sitecore.Resources.Media.UploadWatcher, Sitecore.Kernel"

 <add type="Sitecore.Nexus.Web.HttpModule,Sitecore.Nexus" name="SitecoreHttpModule"/>
 <add type="Sitecore.Resources.Media.UploadWatcher, Sitecore.Kernel"

More detials

Tuesday, 9 June 2015

Wednesday, 20 May 2015

Wednesday, 13 May 2015

What is the Default Data Source for Rendering

 If you do not pass a data source item to a rendering, the context item is the default data source item for that rendering.

John West.

Wednesday, 6 May 2015

Rebuild Link Database

Navigate --> Links is not working fine .. the link was not reflecting the referenced item.

We need to rebuild the link Database.

Control Panel --> Database --> Rebuild the Link Database


Monday, 4 May 2015

How to set and refresh the Drop down list value using jquery


closedxml ClosedXML - The easy way to OpenXML


Tuesday, 21 April 2015


DownThemAll! (DTA) is a download manager/accelerator extension for Mozilla Firefox, licensed under the GPL. It can pause and restart supporting downloads at any time, without losing data, and enables users to download all the links, images or embedded objects contained in a webpage. Both HTTP and FTP protocols are supported.[4]

Wednesday, 15 April 2015

Custom Full Rich Text Editor in Sitecore

 <setting name="HtmlEditor.DefaultProfile" value="/sitecore/system/Settings/Html Editor Profiles/Rich Text Default" />

Change this to

 <setting name="HtmlEditor.DefaultProfile" value="/sitecore/system/Settings/Html Editor Profiles/Rich Text Full" />

Grammarly Spell Checker & Grammar Correction tool

Disable web Editing in Sitecore : Page Editor Mode

if  we want the field to be non editable in Page Editor mode

<sc:Text Field="Your feild " DisableWebEditing="true" runat="server" />

FieldRenderer.Render(HeadingType, "Your Feild", "disable-web-editing=true");

@Html.Sitecore().Field("Field Name", new { DisableWebEdit = true })

Tuesday, 14 April 2015

Customize the Code Analysis Dictionary

CA1704: Identifiers should be spelled correctly

Wednesday, 8 April 2015

Set Reminder for Sitecore content

If you have some promotional content Item .. Set Reminder on that Item in order to remove the item ..Helps a lot

Wednesday, 1 April 2015

Sql Server 2012 Getting ::: Operating system error 5: "5(Access is denied.)"

I was getting the below Error while attaching .mdf file in to Database

Unable to open the physical file "". Operating system error 5: "5(Access is denied.)". (Microsoft SQL Server, Error: 5120)

I have granted the full control to folder containing the file..

This resolved my issue..

More info

Thursday, 26 March 2015

Sitecore Market Place :: Module We Blog

Tuesday, 24 March 2015

TFS Basic Series Part 1 : How to Use Label in TFS 2013

Click File --> Source Control -->Advanced --> Apply label

We need to Provide label Name , Comment, Path and version..

We can also provide label by command line

  1. Click Start, click All Programs, point to Microsoft Visual Studio 2005, point to Visual Studio Tools, and then click Visual Studio 2005 Command Prompt.
  2. Type cd path, where path is the directory that contains the applicable workspace.
  3. Type tf label mylabel . /r.
  4. Attaches the "mylabel" label to the workspace version of the "path" folder and all the files and folders it contains.

We can find the label by

Click File --> Source Control -->Find Label.

We can create branch whenever needed on top of given Label..

Build server automatically label for each build.

We can have multiple label applied to same version of file.

Applying label is as good as creating branch..Labelling should be done quite often while branching to be done rarely..

As a best practices branching should be done only to do patching to release.