Thursday, 29 October 2015

How to remove item's Workflow& WorkflowState programmatically?

using ( new SecurityDisabler() )
{
Item.Editing.BeginEdit();

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

Sitecore.Context.Item.Editing.EndEdit();
}

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
    EXCEPT

 SELECT * FROM tbl_OldData  

Import Data from excel Sheet


 EXEC sp_configure 'Show Advanced Options', 1
RECONFIGURE


EXEC sp_configure 'Ad Hoc Distributed Queries', 1
RECONFIGURE


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



USE SLBSOFTWARE

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

  <!--  LOGIN DISABLE REMEMBER ME
            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

  <!--  LOGIN DISABLE AUTOCOMPLETE
            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

http://blog.istern.dk/2014/05/01/encrypting-and-securing-your-sitecore-connenction-strings/

https://mickeyrahman.wordpress.com/2014/07/15/securing-sitecore-configuration-files-with-server-side-encryption/

Custom item url for Item Bucketing

https://adeneys.wordpress.com/2013/07/19/item-buckets-and-urls/

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"
 file.

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

 <Root>/sitecore/content/your/site/root</Root>

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.





Featured post

Getting Started With SOLR

Getting Started with Solr ·           Features o    Hit highlighting o    Auto correction o    Faceted Search o    Multi lan...