Tuesday, 13 March 2012

Reset Presentation Details

Yo long time haven't post here. There are few things i would like to share but let me start with "Reset Presentation Details" first, the others will be on another post :)

So there was a case that I need to reset the presentation details (the layout didn't follow the layout defined in standard template) for a lot of items. I debugged the Sitecore, and found out very simple code. Here it is


Field field = item.Fields[FieldIDs.LayoutField];
item.Editing.BeginEdit();
field.Reset();
item.Editing.EndEdit();

Enjoy resetting your items haha

Monday, 16 January 2012

Modify ECM User Import

This guide is to help all Sitecore developers who are struggling to modify ECM User Import. As you know that by default, Sitecore changes "@" into "_at_" and "." into "_dot_" for every imported email and it uses default Sitecore profile, perhaps some of you prefer to use your customized profile.

So here we go, but in order to complete this guide, you need to have a software to decompile Sitecore.EmailCampaign.dll.

  1. Firstly, try to find this file \Website\sitecore modules\Shell\EmailCampaign\UI\Dialogs\ImportUsersWizard.xml
  2. Open it, and change the CodeBeside class into your custom class ([Namespace.CustomClass], library name).
  3. Next, you have to recreate the whole ImportUsersWizard, with a customized code in PerformImport function.
  4. Compile your library, and put into the Sitecore bin folder, you are good to go.


Hope this helps. Feel free to leave your comment if you don't understand ^_^