<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;C0AGRHc8cSp7ImA9WhBaE0k.&quot;"><id>tag:blogger.com,1999:blog-630324887720106786</id><updated>2013-05-23T22:42:05.979+02:00</updated><category term="Webservices" /><category term="Code" /><category term="Customize Content Editor" /><category term="Other" /><category term="Shared Source" /><category term="Lucene" /><category term="TDS" /><category term="Localization" /><category term="Error messages" /><category term="Controls" /><category term="Admin and Security" /><category term="Modules" /><category term="VS" /><category term="Webform For Marketers" /><category term="Webedit" /><category term="dtSearch" /><category term="Configuration" /><title>Sitecore Blog</title><subtitle type="html" /><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://sitecoreblog.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://sitecoreblog.blogspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/630324887720106786/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Vangansewinkel Benjamin</name><uri>http://www.blogger.com/profile/01696678283653731912</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="23" height="32" src="http://3.bp.blogspot.com/_Nd7hE7ZxH34/TQYjYUJJL4I/AAAAAAAAABE/TTsBcYDuEoc/S220/ben2.png" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>67</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/SitecoreBlog" /><feedburner:info uri="sitecoreblog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;DEAAR3Y_fip7ImA9WhBXE00.&quot;"><id>tag:blogger.com,1999:blog-630324887720106786.post-7912239686482682701</id><published>2013-03-26T15:01:00.002+01:00</published><updated>2013-03-26T15:05:46.846+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-03-26T15:05:46.846+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Code" /><title>Use and evaluate the Rule field type</title><content type="html">In sitecore one of the field you can use is the "Rule" field. This field is very powerfull and you can easilly implmeent your own rules. Here is a very small tutorial on it.&lt;br /&gt;
&lt;br /&gt;
First of all, on your template you should select the field of thype "Rule":&lt;img border="0" height="11" src="http://3.bp.blogspot.com/-MMEaQiff4Rs/UVGpOY5N3qI/AAAAAAAAAI4/0FkRpgFw2yI/s640/RleField.png" style="cursor: move;" width="640" /&gt;&lt;br /&gt;
&lt;br /&gt;
Now on your item you have an editor like this one:&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-m23jBDOKN-0/UVGpy6A3eAI/AAAAAAAAAJA/FkSMOt9oqCQ/s1600/Rules_Detail.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="436" src="http://1.bp.blogspot.com/-m23jBDOKN-0/UVGpy6A3eAI/AAAAAAAAAJA/FkSMOt9oqCQ/s640/Rules_Detail.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-MMEaQiff4Rs/UVGpOY5N3qI/AAAAAAAAAI4/0FkRpgFw2yI/s1600/RleField.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;
And the following function return is a rule field is true:&lt;br /&gt;
&lt;pre class="csharp" name="code"&gt;public bool EvaluateRule(string fieldName, Item item) 
{
 var ruleContext = new RuleContext();
 foreach (Rule&amp;lt;RuleContext&amp;gt; rule in RuleFactory.GetRules&amp;lt;RuleContext&amp;gt;(new[] { item }, fieldName).Rules)
 {
     if (rule.Condition != null)
     {
  var stack = new RuleStack();
  rule.Condition.Evaluate(ruleContext, stack);

  if (ruleContext.IsAborted)
  {
      continue;
  }
  if ((stack.Count != 0) &amp;amp;&amp;amp; ((bool)stack.Pop()))
  {
      return true;
  }
     }
 }
 
 return false;
}
&lt;/pre&gt;
&lt;img src="http://feeds.feedburner.com/~r/SitecoreBlog/~4/-HnmUH8tuVA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sitecoreblog.blogspot.com/feeds/7912239686482682701/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://sitecoreblog.blogspot.com/2013/03/in-sitecore-one-of-field-you-can-use-is.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/630324887720106786/posts/default/7912239686482682701?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/630324887720106786/posts/default/7912239686482682701?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SitecoreBlog/~3/-HnmUH8tuVA/in-sitecore-one-of-field-you-can-use-is.html" title="Use and evaluate the Rule field type" /><author><name>Vangansewinkel Benjamin</name><uri>http://www.blogger.com/profile/01696678283653731912</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="23" height="32" src="http://3.bp.blogspot.com/_Nd7hE7ZxH34/TQYjYUJJL4I/AAAAAAAAABE/TTsBcYDuEoc/S220/ben2.png" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-MMEaQiff4Rs/UVGpOY5N3qI/AAAAAAAAAI4/0FkRpgFw2yI/s72-c/RleField.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://sitecoreblog.blogspot.com/2013/03/in-sitecore-one-of-field-you-can-use-is.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkcDQ3s5eyp7ImA9WhBXE00.&quot;"><id>tag:blogger.com,1999:blog-630324887720106786.post-3689026447403240240</id><published>2013-03-26T14:14:00.000+01:00</published><updated>2013-03-26T14:21:12.523+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-03-26T14:21:12.523+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Code" /><title>Ajax lazy loading with Sitecore</title><content type="html">For one of our project we need to call some sublayout in ajax. This allow you to do some pagination or lazy loading and let sitecore resolve the context.&lt;br /&gt;
&lt;br /&gt;
To do that, we will create our own LayoutResolver to respond to our query with only the corresponding rendering.&lt;br /&gt;
&lt;br /&gt;
Our call ajax wll look like:&lt;br /&gt;
&lt;pre class="javascript" name="code"&gt;var url = &amp;quot;http://myurl/myItem?UseAjax=true&amp;amp;amp;PresentationId=BACBFEE1-C0BB-4D8E-BA1A-D9F50CCA5B7F&amp;quot;;

$.ajax({
 type: 'GET',
 url: url
}).done(function (data) {
 //Your code
});&lt;/pre&gt;

&lt;p&gt;We will also need a layout for the ajax queries (in the following code the MY_AJAX_LAYOUT_ID is the id of this layout) and this layout will only contain one placeholder (MY_AJAX_PLACEHOLDER in the code)&lt;/p&gt;

Now here is the custom layout resolver (look at the comments into the code):
&lt;pre class="csharp" name="code"&gt;using System;
using System.Linq;
using System.Web;
using Sitecore.Data.Items;
using Sitecore.Pipelines.HttpRequest;

namespace MyNamespace
{
    public class AjaxLayoutResolver : LayoutResolver
    {
        public override void Process(HttpRequestArgs args)
        {
            bool useAjax;
     //First of all let's check if we are in ajax mode or not if not don't continue
            var result = bool.TryParse(HttpContext.Current.Request.Params["UseAjax], out useAjax);
            if (!result || !useAjax)
            {
                return;
            }

     //The second parameter we need to pass is the PresentationId if not present the query if not valid -&gt; don't continue
            var presentationId = HttpContext.Current.Request.Params["PresentationId"];
            if (string.IsNullOrEmpty(presentationId))
            {
                return;
            }

     //If the current item is null return
            if (Sitecore.Context.Item == null)
            {
                return;
            }

     //Let's resolve the sublayout
            try
            {
  //Get the list of rendering for the current item
                var renderings = Sitecore.Context.Item.Visualization.GetRenderings(Sitecore.Context.Device, false);
  //If found
                if (renderings != null &amp;&amp; renderings.Any())
                {
      //Get the first rendering corresponding to the requested one
                    var rendering = renderings.First(sublayout =&gt; sublayout.RenderingID.ToString().Equals(presentationId));
                    if (rendering != null)
                    {             
                        //Put this rendering into ajax layout
                        rendering.Placeholder = MY_AJAX_PLACEHOLDER;
                        var layoutItem = Sitecore.Context.Database.GetItem(MY_AJAX_LAYOUT_ID);
                        if (layoutItem != null)
                        {
                            var layout = new LayoutItem(layoutItem);
                            Sitecore.Context.Page.FilePath = layout.FilePath;
                            Sitecore.Context.Page.ClearRenderings();
                            Sitecore.Context.Page.AddRendering(rendering);
                        }
                    }
                }
            }
            catch (Exception exception)
            {
                Log.Warn("Cannot render this!", this, exception);
            }
        }
    }
}&lt;/pre&gt;

And of could you need to include this resolver after the existing one by adding this into a .config file in \App_Config\Include\
&lt;pre name="code" class="xml"&gt;&amp;lt;configuration xmlns:patch=&amp;quot;http://www.sitecore.net/xmlconfig/&amp;quot;&amp;gt;
  &amp;lt;sitecore&amp;gt;
    &amp;lt;pipelines&amp;gt;
      &amp;lt;httpRequestBegin&amp;gt;          
          &amp;lt;processor patch:after=&amp;quot;*[@type='Sitecore.Pipelines.HttpRequest.LayoutResolver, Sitecore.Kernel']&amp;quot; type=&amp;quot;MyNamespace.AjaxLayoutResolver, MyNamespace&amp;quot;/&amp;gt;          
      &amp;lt;/httpRequestBegin&amp;gt;
    &amp;lt;/pipelines&amp;gt;
  &amp;lt;/sitecore&amp;gt;
&amp;lt;/configuration&amp;gt;&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/SitecoreBlog/~4/6IG8H0XpiZQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sitecoreblog.blogspot.com/feeds/3689026447403240240/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://sitecoreblog.blogspot.com/2013/03/ajax-lazy-loading-with-sitecore.html#comment-form" title="7 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/630324887720106786/posts/default/3689026447403240240?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/630324887720106786/posts/default/3689026447403240240?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SitecoreBlog/~3/6IG8H0XpiZQ/ajax-lazy-loading-with-sitecore.html" title="Ajax lazy loading with Sitecore" /><author><name>Vangansewinkel Benjamin</name><uri>http://www.blogger.com/profile/01696678283653731912</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="23" height="32" src="http://3.bp.blogspot.com/_Nd7hE7ZxH34/TQYjYUJJL4I/AAAAAAAAABE/TTsBcYDuEoc/S220/ben2.png" /></author><thr:total>7</thr:total><feedburner:origLink>http://sitecoreblog.blogspot.com/2013/03/ajax-lazy-loading-with-sitecore.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0YBR3cyeSp7ImA9WhNaEEw.&quot;"><id>tag:blogger.com,1999:blog-630324887720106786.post-4729457891752115981</id><published>2013-01-24T09:12:00.001+01:00</published><updated>2013-01-24T09:12:36.991+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-01-24T09:12:36.991+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Error messages" /><title>Sitecore is not  defined in webedit</title><content type="html">After a migration to sitecore 6.5, the webedit was always say with a message "loading" and we saw an error message "Sitecore is not defined" a javascript. 
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-ACv79Hh0g-s/UQDqBql1N9I/AAAAAAAAAIQ/4CLLkWtnpxM/s1600/screenshot_sitecore_not_defined.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;br /&gt;&lt;img border="0" height="296" src="http://2.bp.blogspot.com/-ACv79Hh0g-s/UQDqBql1N9I/AAAAAAAAAIQ/4CLLkWtnpxM/s640/screenshot_sitecore_not_defined.png" width="680" /&gt;&lt;/a&gt;&lt;/div&gt;
To make it short the resolution is really easy: you just need to remove the following code if you had it before the migration&lt;br /&gt;
&lt;pre class="csharp" name="code"&gt;&amp;lt;sc:Placeholder ID="webedit" Key="webedit" runat="server" /&amp;gt;&lt;/pre&gt;
If you want to go a bit deeper into the cause of this error, the javascipt who cause this error is automatically regenerate by sitecore when not exist. 
If you need to control which codes are inserted into the page when you are in webedit mode you may overide the following configuration. This one have evolve into the version 6.5 and this is the cause of our error.
&lt;br /&gt;
&lt;pre class="xml" code="" name="code"&gt;&amp;lt;pageextender type="Sitecore.Layouts.PageExtenders.WebEditPageExtender" /&amp;gt;&lt;/pre&gt;
&lt;img src="http://feeds.feedburner.com/~r/SitecoreBlog/~4/byTYz1fY4g8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sitecoreblog.blogspot.com/feeds/4729457891752115981/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://sitecoreblog.blogspot.com/2013/01/sitecore-is-not-defined-in-webedit.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/630324887720106786/posts/default/4729457891752115981?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/630324887720106786/posts/default/4729457891752115981?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SitecoreBlog/~3/byTYz1fY4g8/sitecore-is-not-defined-in-webedit.html" title="Sitecore is not  defined in webedit" /><author><name>Vangansewinkel Benjamin</name><uri>http://www.blogger.com/profile/01696678283653731912</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="23" height="32" src="http://3.bp.blogspot.com/_Nd7hE7ZxH34/TQYjYUJJL4I/AAAAAAAAABE/TTsBcYDuEoc/S220/ben2.png" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-ACv79Hh0g-s/UQDqBql1N9I/AAAAAAAAAIQ/4CLLkWtnpxM/s72-c/screenshot_sitecore_not_defined.png" height="72" width="72" /><thr:total>1</thr:total><feedburner:origLink>http://sitecoreblog.blogspot.com/2013/01/sitecore-is-not-defined-in-webedit.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUUMQns4cSp7ImA9WhNUEk8.&quot;"><id>tag:blogger.com,1999:blog-630324887720106786.post-6677619733394713882</id><published>2013-01-03T15:28:00.000+01:00</published><updated>2013-01-03T15:28:03.539+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-01-03T15:28:03.539+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Customize Content Editor" /><title>Add a richtext webedit button with a custom dialog</title><content type="html">I have already create a post about &lt;a href="http://sitecoreblog.blogspot.be/2012/10/add-custom-button-in-rich-text-editor.html"&gt;how to add a custom button into the richtext editor. &lt;/a&gt;&lt;br/&gt;
But if you do that you will maybe also be interested on how to insert a button into the webedit ribbon. Inserting the button is easy but in this post I will also explain how to open a dialog box to interact with webedit. &lt;br/&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;h2&gt;Insert the new button in the toolbar:&lt;/h2&gt;
 &lt;ol&gt;
  &lt;li&gt;First of all, switch into the core database and add your button in the corresponding richtext editor profile. If you need to add it into the “Full” profile, insert a new item based on the template &lt;i&gt;/sitecore/templates/System/WebEdit/WebEdit&lt;/i&gt; Button below: &lt;i&gt;/sitecore/system/Settings/Html Editor Profiles/Rich Text Full/WebEdit Buttons/&lt;/i&gt;&lt;/li&gt;
  &lt;li&gt;Set the properties of your item. The tree important fields here are:
   &lt;ul&gt;
    &lt;li&gt;Icon: the icon to display into the toolbar&lt;/li&gt;
    &lt;li&gt;Click: The event id you need to catch into your javascript (in my example I have set it to ‘chrome:field:linkcolorbox’)&lt;/li&gt;
    &lt;li&gt;Tooltip: the tooltip text when you stay on the button&lt;/li&gt;
   &lt;/ul&gt;
  &lt;/li&gt;
 &lt;/ol&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;h2&gt;Handle the javascript event:&lt;/h2&gt;
 &lt;ol&gt;
  &lt;li&gt;This time we cannot avoid to modify a sitecore javascript file. I have been in contact with the sitecore support and ask to change it as a change request. So edit the file &lt;i&gt;\sitecore\shell\Applications\Page Modes\ChromeTypes\FieldChromeType.js&lt;/i&gt;
Add your own event: search for the line "handleMessage: function (message, params) {" and add a case with your own event. &lt;br/&gt;
In my example here I add this: 
  &lt;pre name="code" class="js"&gt;case &amp;quot;chrome:field:linkcolorbox&amp;quot;:
 this.insertLinkcolorbox();
 break;&lt;/pre&gt;&lt;/li&gt;  
  
  &lt;li&gt;And the related function in the same javascript is:
  &lt;pre name="code" class="js"&gt;insertLinkcolorbox: function () {
 var selectionText;

 // Not MSIE.
 if (window.getSelection &amp;amp;&amp;amp; window.getSelection().getRangeAt) {
  this.selection = window.getSelection().getRangeAt(0);
  selectionText = this.selection.toString();
 }
  // MSIE.
 else if (document.selection &amp;amp;&amp;amp; document.selection.createRange) {
  this.selection = document.selection.createRange();
  selectionText = this.selection.text;
 }

 if ($sc.trim(selectionText) == &amp;quot;&amp;quot;) {
  alert(Sitecore.PageModes.Texts.SelectSomeText);
  return;
 }

 var chars = this.characteristics();
 this.editControl(chars.itemId, chars.language, chars.version, chars.fieldId, this.controlId(), &amp;quot;webedit:linkcolorbox&amp;quot;);
},&lt;/pre&gt;
  You see in this function that we get the selected text and the important line is &lt;pre name="code" class="js"&gt;this.editControl(chars.itemId, chars.language, chars.version, chars.fieldId, this.controlId(), "webedit:linkcolorbox");&lt;/pre&gt; where we have the webedit:linkcolorbox this is the event I will trigger. 
  &lt;/li&gt;
  &lt;li&gt;
  Now in a config file we need to handle this event triggered by the javascript:
  &lt;pre name="code" class="xml"&gt;&amp;lt;configuration xmlns:patch=&amp;quot;http://www.sitecore.net/xmlconfig/&amp;quot;&amp;gt;
  &amp;lt;sitecore&amp;gt;
    &amp;lt;commands&amp;gt;
      &amp;lt;command name=&amp;quot;webedit:linkcolorbox&amp;quot; type=&amp;quot;ColorBox4Sitecore.Webedit.WebeditColorboxLink, ColorBox4Sitecore&amp;quot;/&amp;gt;
    &amp;lt;/commands&amp;gt;
  &amp;lt;/sitecore&amp;gt;
&amp;lt;/configuration&amp;gt;&lt;/pre&gt;
  Notice that the name must be the same as the one in the javascript and of course the type value correspond to a class in my project who inherit from WebEditCommand.
  &lt;/li&gt;
 &lt;/ol&gt;
  &lt;/li&gt;
  &lt;li&gt;
 &lt;h2&gt;Handle the webedit command:&lt;/h2&gt;
 Here is my class:
 &lt;pre name="code" class="csharp"&gt;using Sitecore;
using Sitecore.Resources;
using Sitecore.Shell.Applications.WebEdit.Commands;
using Sitecore.Shell.Framework.Commands;
using Sitecore.Text;
using Sitecore.Web.UI.Sheer;

namespace ColorBox4Sitecore.Webedit
{
    public class WebeditColorboxLink : WebEditCommand
    {
        // Methods
        public override void Execute(CommandContext context)
        {
            Context.ClientPage.Start(this, &amp;quot;Run&amp;quot;, context.Parameters);
        }

        protected static void Run(ClientPipelineArgs args)
        {
            if (args.IsPostBack)
            {
                if (args.HasResult)
                {
                    //The response to the javascript
                    SheerResponse.Eval(&amp;quot;window.parent.Sitecore.PageModes.ChromeManager.handleMessage('chrome:field:colorboxlinkinserted',{{colorboxClass:{0}}})&amp;quot;, new object[] { args.Result });
                }
            }
            else
            {
                //The dialog to run
                UrlString str = ResourceUri.Parse(&amp;quot;control:RichText.ColorboxLink&amp;quot;).ToUrlString();
                str.Add(&amp;quot;mo&amp;quot;, &amp;quot;webedit&amp;quot;);
                str.Add(&amp;quot;la&amp;quot;, args.Parameters[&amp;quot;language&amp;quot;]);
                SheerResponse.ShowModalDialog(str.ToString(), true);
                args.WaitForPostBack();
            }
        }
    }
}&lt;/pre&gt;
 In this class you will need to change 2 lines: 
&lt;pre name="code" class="csharp"&gt;UrlString str = ResourceUri.Parse("control:RichText.ColorboxLink").ToUrlString();&lt;/pre&gt;
The value in the parse here is the dialog to display the id must correspond to the first xml tag just below the control tag (in the example here my tag is &amp;lt;RichText.ColorboxLink&amp;gt;).
The second thing to change is the line:
&lt;pre name="code" class="csharp"&gt;SheerResponse.Eval("window.parent.Sitecore.PageModes.ChromeManager.handleMessage('chrome:field:colorboxlinkinserted',{{colorboxClass:{0}}})", new object[] { args.Result });&lt;/pre&gt;
The value here is the message we will send back to the javascript when the user will click on the on button of my dialog. I will come back to this step later.
  &lt;/li&gt;
  
  &lt;li&gt;
 &lt;h2&gt;Create the dialog:&lt;/h2&gt;
 The files for my dialog are the same as in my previous post this code is common for the webedit and the normal richtext (I have just change a little bit the c# code to enable the webedit) 
 &lt;pre name="code" class="xml"&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot; ?&amp;gt;
&amp;lt;control xmlns:def=&amp;quot;Definition&amp;quot; xmlns=&amp;quot;http://schemas.sitecore.net/Visual-Studio-Intellisense&amp;quot;&amp;gt;
  &amp;lt;RichText.ColorboxLink&amp;gt;
    &amp;lt;FormDialog Icon=&amp;quot;Network/32x32/link.png&amp;quot; Header=&amp;quot;Insert a Colorbox Link&amp;quot;
      Text=&amp;quot;Select the colorbox class.&amp;quot; OKButton=&amp;quot;Link&amp;quot;&amp;gt;

      &amp;lt;script Type=&amp;quot;text/javascript&amp;quot; Language=&amp;quot;javascript&amp;quot; Src=&amp;quot;/sitecore/shell/Controls/Rich Text Editor/ColorboxLink/ColorboxLink.js&amp;quot;&amp;gt;.&amp;lt;/script&amp;gt;

      &amp;lt;CodeBeside Type=&amp;quot;ColorBox4Sitecore.UI.sitecore_modules.Shell.Controls.Rich_Text_Editor.ColorboxLink.ColorboxLink, ColorBox4Sitecore.UI&amp;quot;/&amp;gt;

      &amp;lt;Border Padding=&amp;quot;4px 0px 4px 0px&amp;quot;&amp;gt;
        &amp;lt;GridPanel Width=&amp;quot;100%&amp;quot; Columns=&amp;quot;2&amp;quot;&amp;gt;
          &amp;lt;Border Padding=&amp;quot;0px 4px 0px 0px&amp;quot;&amp;gt;
            &amp;lt;Literal Text=&amp;quot;Colorbox class:&amp;quot;/&amp;gt;
          &amp;lt;/Border&amp;gt;

          &amp;lt;Edit ID=&amp;quot;ColorboxClass&amp;quot; Width=&amp;quot;100%&amp;quot; GridPanel.Width=&amp;quot;100%&amp;quot;/&amp;gt;
        &amp;lt;/GridPanel&amp;gt;
      &amp;lt;/Border&amp;gt;
    &amp;lt;/FormDialog&amp;gt;
  &amp;lt;/RichText.ColorboxLink&amp;gt;
&amp;lt;/control&amp;gt;
&lt;/pre&gt;
 The c# code is:
 &lt;pre name="code" class="csharp"&gt;using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Sitecore;
using Sitecore.Data;
using Sitecore.Data.Items;
using Sitecore.Diagnostics;
using Sitecore.IO;
using Sitecore.Shell.Framework;
using Sitecore.Web;
using Sitecore.Web.UI.HtmlControls;
using Sitecore.Web.UI.Pages;
using Sitecore.Web.UI.Sheer;

namespace ColorBox4Sitecore.UI.sitecore_modules.Shell.Controls.Rich_Text_Editor.ColorboxLink
{
    public class ColorboxLink : DialogForm
    {
        // Fields
        protected Edit ColorboxClass;
        protected Edit ColorboxText;

        protected override void OnCancel(object sender, EventArgs args)
        {
            Assert.ArgumentNotNull(sender, &amp;quot;sender&amp;quot;);
            Assert.ArgumentNotNull(args, &amp;quot;args&amp;quot;);
            if (this.Mode == &amp;quot;webedit&amp;quot;)
            {
                base.OnCancel(sender, args);
            }
            else
            {
                SheerResponse.Eval(&amp;quot;scCancel()&amp;quot;);
            }
        }
        
        protected override void OnOK(object sender, EventArgs args)
        {
            Assert.ArgumentNotNull(sender, &amp;quot;sender&amp;quot;);
            Assert.ArgumentNotNull(args, &amp;quot;args&amp;quot;);
            if (string.IsNullOrWhiteSpace(ColorboxClass.Value))
            {
                SheerResponse.Alert(&amp;quot;Please enter a Colorbox class.&amp;quot;, new string[0]);
            }

            if (this.Mode == &amp;quot;webedit&amp;quot;)
            {
                SheerResponse.SetDialogValue(StringUtil.EscapeJavascriptString(ColorboxClass.Value));
                base.OnOK(sender, args);
            }
            else
            {
                SheerResponse.Eval(&amp;quot;scClose('&amp;quot; + ColorboxClass.Value + &amp;quot;')&amp;quot;);
            }
        }

        // Properties
        protected string Mode
        {
            get
            {
                string str = StringUtil.GetString(base.ServerProperties[&amp;quot;Mode&amp;quot;]);
                if (!string.IsNullOrEmpty(str))
                {
                    return str;
                }
                str = WebUtil.GetQueryString(&amp;quot;mo&amp;quot;);
                if (!string.IsNullOrEmpty(str))
                {
                    return str;
                }
                return &amp;quot;shell&amp;quot;;
            }
            set
            {
                Assert.ArgumentNotNull(value, &amp;quot;value&amp;quot;);
                base.ServerProperties[&amp;quot;Mode&amp;quot;] = value;
            }
        }
    }
}&lt;/pre&gt;
Nothing special in this class the important line is: 
&lt;pre name="code" class="js"&gt;SheerResponse.SetDialogValue(StringUtil.EscapeJavascriptString(ColorboxClass.Value));&lt;/pre&gt; where we pass the parameters to send back.&lt;br/&gt;&lt;br/&gt;
And the JS code (normally you shouldn't change it)
&lt;pre name="code" class="js"&gt;function GetDialogArguments() {
    return getRadWindow().ClientParameters;
}

function getRadWindow() {
  if (window.radWindow) {
        return window.radWindow;
  }
    
    if (window.frameElement &amp;amp;&amp;amp; window.frameElement.radWindow) {
        return window.frameElement.radWindow;
    }
    
    return null;
}

var isRadWindow = true;

var radWindow = getRadWindow();

if (radWindow) { 
  if (window.dialogArguments) { 
    radWindow.Window = window;
  } 
}


function scClose(colorboxClass) {
    var returnValue = {
        colorboxClass: colorboxClass
    };

    getRadWindow().close(returnValue);

}

function scCancel() {
  getRadWindow().close();
}

function scCloseWebEdit(colorboxClass) {
    window.returnValue = colorboxClass;
    window.close();
}

if (window.focus &amp;amp;&amp;amp; Prototype.Browser.Gecko) {
  window.focus();
}&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
 &lt;h2&gt;Handle the response message:&lt;/h2&gt;
 When the user click on ok, sitecore will pass on this line in the dialog box: 
 &lt;pre name="code" class="js"&gt;SheerResponse.SetDialogValue(StringUtil.EscapeJavascriptString(ColorboxClass.Value));&lt;/pre&gt;
 This line return send arguments to the WebEditCommand and we will have arguments so it will pass into this code:
 &lt;pre name="code" class="js"&gt;if (args.IsPostBack)
{
 if (args.HasResult)
 {
  //The response to the javascript
  SheerResponse.Eval(&amp;quot;window.parent.Sitecore.PageModes.ChromeManager.handleMessage('chrome:field:colorboxlinkinserted',{{colorboxClass:{0}}})&amp;quot;, new object[] { args.Result });
 }
}&lt;/pre&gt;
 And this code will send the message 'chrome:field:colorboxlinkinserted’ with one argument.
  &lt;/li&gt;
  
  &lt;li&gt;
 &lt;h2&gt;Handle the response message in the JS:&lt;/h2&gt;
 Now as we did in the beginning in FieldChromeType.js we need to handle the message in the javascript so:&lt;br /&gt;
Add a new case in the handleMessage method, in my example it is this one :
 &lt;pre name="code" class="js"&gt;case &amp;quot;chrome:field:colorboxlinkinserted&amp;quot;:
 this.colorboxlinkinserted(params.colorboxClass);
 break;&lt;/pre&gt;
 And my function is:
 &lt;pre name="code" class="js"&gt;colorboxlinkinserted: function (colorboxClass) {
 var isIE = document.selection &amp;amp;&amp;amp; document.selection.createRange;
 if (!this.selection) {
  return;
 }

 // TODO: add preserving link contents for FF.
 var data = {
  html: isIE ? this.selection.htmlText : this.selection.toString(),
  colorboxClass: colorboxClass
 };

 // If link is selected, replace it with a new one, preserving link contents.
 if (isIE) {
  // OT issue#338106
  data.html = this._processHtml(data.html);
  var htmlSelection = $sc.trim(data.html.toLowerCase()) || &amp;quot;&amp;quot;;
  if (htmlSelection.indexOf(&amp;quot;&amp;lt;a &amp;quot;) == 0 &amp;amp;&amp;amp; htmlSelection.indexOf(&amp;quot;&amp;lt;/a&amp;gt;&amp;quot;) == (htmlSelection.length - &amp;quot;&amp;lt;/a&amp;gt;&amp;quot;.length)) {
   htmlSelection = data.html.substring(data.html.indexOf(&amp;quot;&amp;gt;&amp;quot;) + 1);
   htmlSelection = htmlSelection.substring(0, htmlSelection.length - &amp;quot;&amp;lt;/a&amp;gt;&amp;quot;.length);
   data.html = htmlSelection;
  }
 }

 var htmlToInsert = &amp;quot;&amp;lt;a href='#' class='&amp;quot; + data.colorboxClass + &amp;quot;'&amp;gt;&amp;quot; + data.html + &amp;quot;&amp;lt;/a&amp;gt;&amp;quot;;
 if (isIE) {
  this.selection.pasteHTML(htmlToInsert);
 }
 else {
  node = this.selection.createContextualFragment(htmlToInsert);
  this.selection.deleteContents();
  this.selection.insertNode(node);
 }

 this.setModified();
},&lt;/pre&gt;
  &lt;/li&gt;
&lt;/ol&gt;&lt;img src="http://feeds.feedburner.com/~r/SitecoreBlog/~4/_3q-hmw8W9A" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sitecoreblog.blogspot.com/feeds/6677619733394713882/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://sitecoreblog.blogspot.com/2013/01/add-richtext-webedit-button-with-custom.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/630324887720106786/posts/default/6677619733394713882?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/630324887720106786/posts/default/6677619733394713882?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SitecoreBlog/~3/_3q-hmw8W9A/add-richtext-webedit-button-with-custom.html" title="Add a richtext webedit button with a custom dialog" /><author><name>Vangansewinkel Benjamin</name><uri>http://www.blogger.com/profile/01696678283653731912</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="23" height="32" src="http://3.bp.blogspot.com/_Nd7hE7ZxH34/TQYjYUJJL4I/AAAAAAAAABE/TTsBcYDuEoc/S220/ben2.png" /></author><thr:total>2</thr:total><feedburner:origLink>http://sitecoreblog.blogspot.com/2013/01/add-richtext-webedit-button-with-custom.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0QNRXY-fyp7ImA9WhNVE04.&quot;"><id>tag:blogger.com,1999:blog-630324887720106786.post-4799522059652088530</id><published>2012-12-21T09:30:00.001+01:00</published><updated>2012-12-24T08:49:54.857+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-12-24T08:49:54.857+01:00</app:edited><title>WCF credentials</title><content type="html">This time it is not a sitecore post but I had to search a long time to find how to put my WCF service authentication in the web.config file.&lt;br /&gt;
To pass the service credentials in the code it is easy: 
&lt;br /&gt;
&lt;pre class="csharp" name="code"&gt;myServiceClient.ClientCredentials.Windows.ClientCredential = new System.Net.NetworkCredential("myUsername", "myPassword", "myDomain");&lt;/pre&gt;
But to put those credentials into the web.config it is a bit more complex.

&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Create this class:
&lt;pre class="csharp" name="code"&gt;using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.ServiceModel.Configuration;
using System.ServiceModel.Description;
using System.Text;

namespace MyNamespace
{
    public class UserNameClientCredentialsElement : ClientCredentialsElement
    {
        private ConfigurationPropertyCollection properties;

        public override Type BehaviorType
        {
            get { return typeof(ClientCredentials); }
        }

        /// &amp;lt;summary&amp;gt;
        /// Username (required)
        /// &amp;lt;/summary&amp;gt;
        public string UserName
        {
            get { return (string)base["userName"]; }
            set { base["userName"] = value; }
        }

        /// &amp;lt;summary&amp;gt;
        /// Password (optional)
        /// &amp;lt;/summary&amp;gt;
        public string Password
        {
            get { return (string)base["password"]; }
            set { base["password"] = value; }
        }

        protected override ConfigurationPropertyCollection Properties
        {
            get
            {
                if (properties == null)
                {
                    ConfigurationPropertyCollection baseProps = base.Properties;
                    baseProps.Add(new ConfigurationProperty(
                                      "userName",
                                      typeof(String),
                                      null,
                                      null,
                                      new StringValidator(1),
                                      ConfigurationPropertyOptions.IsRequired));
                    baseProps.Add(new ConfigurationProperty(
                                      "password",
                                      typeof(String),
                                      ""));
                    properties = baseProps;
                }
                return properties;
            }
        }

        protected override object CreateBehavior()
        {
            var creds = (ClientCredentials)base.CreateBehavior();
            if(creds != null)
                creds.Windows.ClientCredential = new NetworkCredential(UserName, Password);            
            return creds;
        }
    }
}&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;Register the behaviorExtension&lt;/li&gt;
&lt;li&gt;Use your new extension&lt;/li&gt;
&lt;/ol&gt;
Now your web.config should look like:
&lt;br /&gt;
&lt;pre class="xml" name="code"&gt;&amp;lt;system.serviceModel&amp;gt;
  &amp;lt;client&amp;gt;&amp;lt;!--(3)--&amp;gt;
    &amp;lt;endpoint ...YourEndpointConfig... behaviorConfiguration="UserNamePasswordBehavior" /&amp;gt;
  &amp;lt;/client&amp;gt;
  &amp;lt;behaviors&amp;gt;&amp;lt;!--(2)--&amp;gt;
    &amp;lt;endpointBehaviors&amp;gt;
      &amp;lt;behavior name="UserNamePasswordBehavior"&amp;gt;
        &amp;lt;userNameClientCredentials userName="skroob" password="12345" /&amp;gt;
        &amp;lt;!--Visual Studio will give you warning squiggly on &amp;lt;userNameClientCredentials&amp;gt;
            saying that "The element 'behavior' has invalid child element" 
            but will work at runtime.--&amp;gt;
      &amp;lt;/behavior&amp;gt;
    &amp;lt;/endpointBehaviors&amp;gt;
  &amp;lt;/behaviors&amp;gt;
  &amp;lt;extensions&amp;gt;&amp;lt;!--(1)--&amp;gt;
    &amp;lt;behaviorExtensions&amp;gt;
      &amp;lt;add name="userNameClientCredentials" type="MyNamespace.UserNameClientCredentialsElement, MyAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" /&amp;gt;
    &amp;lt;/behaviorExtensions&amp;gt;
  &amp;lt;/extensions&amp;gt;
  ...
&amp;lt;/system.serviceModel&amp;gt;&lt;/pre&gt;
Thanks a lot to Patrick Paquet to post this answer on &lt;a href="http://stackoverflow.com/questions/3725294/set-wcf-clientcredentials-in-app-config"&gt;this topic&lt;/a&gt;
&lt;img src="http://feeds.feedburner.com/~r/SitecoreBlog/~4/pZ_sB8IVbY0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sitecoreblog.blogspot.com/feeds/4799522059652088530/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://sitecoreblog.blogspot.com/2012/12/wcf-credentials.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/630324887720106786/posts/default/4799522059652088530?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/630324887720106786/posts/default/4799522059652088530?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SitecoreBlog/~3/pZ_sB8IVbY0/wcf-credentials.html" title="WCF credentials" /><author><name>Vangansewinkel Benjamin</name><uri>http://www.blogger.com/profile/01696678283653731912</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="23" height="32" src="http://3.bp.blogspot.com/_Nd7hE7ZxH34/TQYjYUJJL4I/AAAAAAAAABE/TTsBcYDuEoc/S220/ben2.png" /></author><thr:total>0</thr:total><feedburner:origLink>http://sitecoreblog.blogspot.com/2012/12/wcf-credentials.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkMHRHs8eip7ImA9WhNXEUQ.&quot;"><id>tag:blogger.com,1999:blog-630324887720106786.post-234810832239620865</id><published>2012-11-29T14:07:00.000+01:00</published><updated>2012-11-29T14:07:15.572+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-11-29T14:07:15.572+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Code" /><title>Use some asp controls into a XAML control</title><content type="html">Here is a small tips to use the standard asp controls in a xaml application. &lt;br/&gt;
&lt;br/&gt;
You just need to add this line into the xamlControls declaration:
&lt;pre name="code" class="xml"&gt;xmlns:asp=&amp;quot;http://www.sitecore.net/microsoft/webcontrols&amp;quot;&lt;/pre&gt;&lt;br/&gt;

Here is a small example:
&lt;pre name="code" class="xml"&gt;
&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
&amp;lt;xamlControls
  xmlns:x=&amp;quot;http://www.sitecore.net/xaml&amp;quot;
  xmlns:ajax=&amp;quot;http://www.sitecore.net/ajax&amp;quot;
  xmlns:rest=&amp;quot;http://www.sitecore.net/rest&amp;quot;
  xmlns:r=&amp;quot;http://www.sitecore.net/renderings&amp;quot;
  xmlns:xmlcontrol=&amp;quot;http://www.sitecore.net/xmlcontrols&amp;quot;
  xmlns:p=&amp;quot;http://schemas.sitecore.net/Visual-Studio-Intellisense&amp;quot;
  xmlns:asp=&amp;quot;http://www.sitecore.net/microsoft/webcontrols&amp;quot;
  xmlns:html=&amp;quot;http://www.sitecore.net/microsoft/htmlcontrols&amp;quot;
  xmlns:xsl=&amp;quot;http://www.w3.org/1999/XSL/Transform&amp;quot;
  xmlns:wfm=&amp;quot;http://www.sitecore.net/wfm/webcontrols&amp;quot;&amp;gt;
   &amp;lt;MyNamespace.MyClass x:inherits=&amp;quot;MyNamespace.MyClass, MyNamespace&amp;quot;&amp;gt;
  &amp;lt;asp:TextBox ID=&amp;quot;tMyTextBox&amp;quot; runat=&amp;quot;server&amp;quot; Width=&amp;quot;97%&amp;quot;/&amp;gt;
   &amp;lt;/MyNamespace.MyClass&amp;gt;
&amp;lt;/xamlControls&amp;gt;
&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/SitecoreBlog/~4/HH6W-UsTOfM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sitecoreblog.blogspot.com/feeds/234810832239620865/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://sitecoreblog.blogspot.com/2012/11/use-some-asp-controls-into-xaml-control.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/630324887720106786/posts/default/234810832239620865?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/630324887720106786/posts/default/234810832239620865?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SitecoreBlog/~3/HH6W-UsTOfM/use-some-asp-controls-into-xaml-control.html" title="Use some asp controls into a XAML control" /><author><name>Vangansewinkel Benjamin</name><uri>http://www.blogger.com/profile/01696678283653731912</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="23" height="32" src="http://3.bp.blogspot.com/_Nd7hE7ZxH34/TQYjYUJJL4I/AAAAAAAAABE/TTsBcYDuEoc/S220/ben2.png" /></author><thr:total>0</thr:total><feedburner:origLink>http://sitecoreblog.blogspot.com/2012/11/use-some-asp-controls-into-xaml-control.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUEAR3c9fCp7ImA9WhNSGEk.&quot;"><id>tag:blogger.com,1999:blog-630324887720106786.post-5307174393866532140</id><published>2012-11-02T09:07:00.002+01:00</published><updated>2012-11-02T09:07:26.964+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-11-02T09:07:26.964+01:00</app:edited><title>Install a TDS package into your code</title><content type="html">Here is a code snippet to install a TDS package into your code:

&lt;pre class="csharp" name="code"&gt;public void InstallTDSPackage(string path)
{
    bool hasPostAction;
    string historyPath;

    // Use default logger
    ILog log = LogManager.GetLogger(&amp;quot;root&amp;quot;);
    XmlConfigurator.Configure((XmlElement)ConfigurationManager.GetSection(&amp;quot;log4net&amp;quot;));

    using (new SecurityDisabler())
    {
        DiffInstaller installer = new DiffInstaller(UpgradeAction.Upgrade);
        MetadataView view = UpdateHelper.LoadMetadata(path);

        //Get the package entries
        List&amp;lt;ContingencyEntry&amp;gt; entries = installer.InstallPackage(path, InstallMode.Install, log, out hasPostAction, out historyPath);

        installer.ExecutePostInstallationInstructions(path, historyPath, InstallMode.Install, view, log, ref entries);

        UpdateHelper.SaveInstallationMessages(entries, historyPath);
    }
}&lt;/pre&gt;
&lt;img src="http://feeds.feedburner.com/~r/SitecoreBlog/~4/LQqE4CCpOm0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sitecoreblog.blogspot.com/feeds/5307174393866532140/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://sitecoreblog.blogspot.com/2012/11/install-tds-package-into-your-code.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/630324887720106786/posts/default/5307174393866532140?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/630324887720106786/posts/default/5307174393866532140?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SitecoreBlog/~3/LQqE4CCpOm0/install-tds-package-into-your-code.html" title="Install a TDS package into your code" /><author><name>Vangansewinkel Benjamin</name><uri>http://www.blogger.com/profile/01696678283653731912</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="23" height="32" src="http://3.bp.blogspot.com/_Nd7hE7ZxH34/TQYjYUJJL4I/AAAAAAAAABE/TTsBcYDuEoc/S220/ben2.png" /></author><thr:total>0</thr:total><feedburner:origLink>http://sitecoreblog.blogspot.com/2012/11/install-tds-package-into-your-code.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUMDSH8-eCp7ImA9WhNSGEk.&quot;"><id>tag:blogger.com,1999:blog-630324887720106786.post-6481254005941368609</id><published>2012-11-02T09:04:00.001+01:00</published><updated>2012-11-02T09:04:39.150+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-11-02T09:04:39.150+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Code" /><title>Install a sitecore package in your code</title><content type="html">Here is a code snippet to install a sitecore package into your code:

&lt;pre class="csharp" name="code"&gt;public void InstallPackage(string path)
{
    bool hasPostAction;
    string historyPath;

    // Use default logger
    ILog log = LogManager.GetLogger(&amp;quot;root&amp;quot;);
    XmlConfigurator.Configure((XmlElement)ConfigurationManager.GetSection(&amp;quot;log4net&amp;quot;));

    FileInfo pkgFile = new FileInfo(path);

    if (!pkgFile.Exists)
        throw new ClientAlertException(string.Format(&amp;quot;Cannot access path '{0}'. Please check path setting.&amp;quot;, path));

    Sitecore.Context.SetActiveSite(&amp;quot;shell&amp;quot;);
    using (new SecurityDisabler())
    {
        using (new ProxyDisabler())
        {
            using (new SyncOperationContext())
            {
                Sitecore.Install.Framework.IProcessingContext context = new Sitecore.Install.Framework.SimpleProcessingContext(); // 
                Sitecore.Install.Items.IItemInstallerEvents events =
                    new Sitecore.Install.Items.DefaultItemInstallerEvents(new Sitecore.Install.Utils.BehaviourOptions(Sitecore.Install.Utils.InstallMode.Overwrite, Sitecore.Install.Utils.MergeMode.Undefined));
                context.AddAspect(events);
                Sitecore.Install.Files.IFileInstallerEvents events1 = new Sitecore.Install.Files.DefaultFileInstallerEvents(true);
                context.AddAspect(events1);
                var inst = new Sitecore.Install.Installer();
                inst.InstallPackage(Sitecore.MainUtil.MapPath(path), context);
            }
        }
    }            
}&lt;/pre&gt;
&lt;img src="http://feeds.feedburner.com/~r/SitecoreBlog/~4/HJJnTMRy5DI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sitecoreblog.blogspot.com/feeds/6481254005941368609/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://sitecoreblog.blogspot.com/2012/11/install-sitecore-package-in-your-code.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/630324887720106786/posts/default/6481254005941368609?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/630324887720106786/posts/default/6481254005941368609?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SitecoreBlog/~3/HJJnTMRy5DI/install-sitecore-package-in-your-code.html" title="Install a sitecore package in your code" /><author><name>Vangansewinkel Benjamin</name><uri>http://www.blogger.com/profile/01696678283653731912</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="23" height="32" src="http://3.bp.blogspot.com/_Nd7hE7ZxH34/TQYjYUJJL4I/AAAAAAAAABE/TTsBcYDuEoc/S220/ben2.png" /></author><thr:total>0</thr:total><feedburner:origLink>http://sitecoreblog.blogspot.com/2012/11/install-sitecore-package-in-your-code.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0YMRn4_fCp7ImA9WhBTFUo.&quot;"><id>tag:blogger.com,1999:blog-630324887720106786.post-8064753433519780180</id><published>2012-10-25T11:09:00.000+02:00</published><updated>2013-02-11T11:39:47.044+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-02-11T11:39:47.044+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Customize Content Editor" /><title>Add a custom button in the rich text editor</title><content type="html">&lt;p&gt;For one of my tasks I had to add a custom button in the sitecore rich text editor (RADEditor) to open a dialog box. But we don’t find a lot of documentation about that on the web. The only post I have found about this is this one: http://www.awareweb.com/AwareBlog/9-21-11-HyperlinkMgr.aspx which is a good start but with this method we need to decompile the code of the RADEditor and override the Rich Text Editor javascript.&lt;/p&gt;
&lt;p&gt;Here is another method to create a button without overriding the code for sitecore and RADEditor.&lt;/p&gt;
&lt;p&gt;First of all, we will add the new button in the interface. As you may know they are different profiles for the rich text. A profile define which features and button are available for a specific field. By default, the selected profile in the “Rich Text Default” but you may specify which profile you want need to be apply by setting the datasource of the field.  (example: /sitecore/system/Settings/Html Editor Profiles/Rich Text Full). In this example, I will add a button in the Toolbar 1 of the Full profile.&lt;/p&gt;
&lt;p&gt;So, in the core database, add an item in of type /sitecore/templates/System/Html Editor Profiles/Html Editor Button below /sitecore/system/Settings/Html Editor Profiles/Rich Text Full/Toolbar 1. Assign an icon to you item and in the field “Click” add an id for your action. In this example the field “Click” is set to “TestBtn”.&lt;/p&gt;
&lt;p&gt;Now, we need to handle this action in the javascript. By default, those actions are handled in \sitecore\shell\Controls\Rich Text Editor\RichText Commands.js but I don’t want to modify the default file to stay as updatable as possible with the future versions of sitecore. By using my friend Reflector, I have found a work around. You may add some javascript in the Rich Text Editor IFrame by adding it in the config below the node /configuration/sitecore/Clientscript/htmleditor. So for my example, add this config file in \App_Config\Include:
&lt;pre name="code" class="xml"&gt;&amp;lt;configuration xmlns:patch=&amp;quot;http://www.sitecore.net/xmlconfig/&amp;quot;&amp;gt;
  &amp;lt;sitecore&amp;gt;
    &amp;lt;clientscripts&amp;gt;
      &amp;lt;htmleditor&amp;gt;
        &amp;lt;script src=&amp;quot;/sitecore/shell/Controls/Rich Text Editor/TestBtn/TestBtn Commands.js&amp;quot; language=&amp;quot;JavaScript&amp;quot;/&amp;gt;
      &amp;lt;/htmleditor&amp;gt;
    &amp;lt;/clientscripts&amp;gt;
  &amp;lt;/sitecore&amp;gt;
&amp;lt;/configuration&amp;gt;
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;And the content of this new javascript file located into /sitecore/shell/Controls/Rich Text Editor/TestBtn/TestBtn Commands.js is:
&lt;pre name="code" class="xml"&gt;var scEditor = null;
var scTool = null;

//Set the Id of your button into the RadEditorCommandList[]
RadEditorCommandList[&amp;quot;TestBtn&amp;quot;] = function (commandName, editor, args) {
    var d = Telerik.Web.UI.Editor.CommandList._getLinkArgument(editor);
    Telerik.Web.UI.Editor.CommandList._getDialogArguments(d, &amp;quot;A&amp;quot;, editor, &amp;quot;DocumentManager&amp;quot;);

 //Retrieve the html selected in the editor
    var html = editor.getSelectionHtml();

    scEditor = editor;

 //Call your custom dialog box
    editor.showExternalDialog(
  &amp;quot;/sitecore/shell/default.aspx?xmlcontrol=RichText.TestBtn&amp;amp;la=&amp;quot; + scLanguage,
  null, //argument
  500, //Height
  180, //Width
  scTestBtnCallback, //callback
  null, // callback args
  &amp;quot;TestBtn&amp;quot;,
  true, //modal
  Telerik.Web.UI.WindowBehaviors.Close, // behaviors
  false, //showStatusBar
  false //showTitleBar
   );
};

//The function called when the user close the dialog
function scTestBtnCallback(sender, returnValue) {
    if (!returnValue) {
        return;
    }
 
 //You may retreive some code from your returnValue
 
 //For the example I add Hello and my return value in the Rich Text
    scEditor.pasteHtml(&amp;quot;Hello &amp;quot; + returnValue.text, &amp;quot;DocumentManager&amp;quot;);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;And the dialog as a XAML form located into /sitecore/shell/Controls/Rich Text Editor/TestBtn/TestBtn.xml is:
&lt;pre name="code" class="xml"&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot; ?&amp;gt;
&amp;lt;control xmlns:def=&amp;quot;Definition&amp;quot; xmlns=&amp;quot;http://schemas.sitecore.net/Visual-Studio-Intellisense&amp;quot;&amp;gt;
  &amp;lt;RichText.TestBtn&amp;gt;
    &amp;lt;FormDialog Icon=&amp;quot;Network/32x32/link.png&amp;quot; Header=&amp;quot;Insert a html code&amp;quot;
      Text=&amp;quot;Insert a html code.&amp;quot; OKButton=&amp;quot;Link&amp;quot;&amp;gt;

      &amp;lt;script Type=&amp;quot;text/javascript&amp;quot; Language=&amp;quot;javascript&amp;quot; Src=&amp;quot;/sitecore/shell/Controls/Rich Text Editor/TestBtn/TestBtn.js&amp;quot;&amp;gt;.&amp;lt;/script&amp;gt;

      &amp;lt;CodeBeside Type=&amp;quot;MyNameSpace.TestBtn, MyDll&amp;quot;/&amp;gt;

      &amp;lt;Border Padding=&amp;quot;4px 0px 4px 0px&amp;quot;&amp;gt;
        &amp;lt;GridPanel Width=&amp;quot;100%&amp;quot; Columns=&amp;quot;2&amp;quot;&amp;gt;
          &amp;lt;Border Padding=&amp;quot;0px 4px 0px 0px&amp;quot;&amp;gt;
            &amp;lt;Literal Text=&amp;quot;Enter you text:&amp;quot;/&amp;gt;
          &amp;lt;/Border&amp;gt;

          &amp;lt;Edit ID=&amp;quot;TextEdit&amp;quot; Width=&amp;quot;100%&amp;quot; GridPanel.Width=&amp;quot;100%&amp;quot;/&amp;gt;
        &amp;lt;/GridPanel&amp;gt;
      &amp;lt;/Border&amp;gt;
    &amp;lt;/FormDialog&amp;gt;
  &amp;lt;/RichText.TestBtn&amp;gt;
&amp;lt;/control&amp;gt;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The associate cs file. This file is located into /sitecore/shell/Controls/Rich Text Editor/TestBtn/TestBtn.cs is:
&lt;pre name="code" class="xml"&gt;using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Sitecore;
using Sitecore.Data;
using Sitecore.Data.Items;
using Sitecore.Diagnostics;
using Sitecore.IO;
using Sitecore.Shell.Framework;
using Sitecore.Web;
using Sitecore.Web.UI.HtmlControls;
using Sitecore.Web.UI.Pages;
using Sitecore.Web.UI.Sheer;

namespace MyNamespace
{
    public class TestBtn : DialogForm
    {
        // Fields
        protected Edit TextEdit;

        protected override void OnCancel(object sender, EventArgs args)
        {
            Assert.ArgumentNotNull(sender, &amp;quot;sender&amp;quot;);
            Assert.ArgumentNotNull(args, &amp;quot;args&amp;quot;);
            if (this.Mode == &amp;quot;webedit&amp;quot;)
            {
                base.OnCancel(sender, args);
            }
            else
            {
                SheerResponse.Eval(&amp;quot;scCancel()&amp;quot;);
            }
        }
        
        protected override void OnOK(object sender, EventArgs args)
        {
            Assert.ArgumentNotNull(sender, &amp;quot;sender&amp;quot;);
            Assert.ArgumentNotNull(args, &amp;quot;args&amp;quot;);
            if (string.IsNullOrWhiteSpace(TextEdit.Value))
            {
                SheerResponse.Alert(&amp;quot;Please enter a html code.&amp;quot;, new string[0]);
            }

            if (this.Mode == &amp;quot;webedit&amp;quot;)
            {
                //SheerResponse.SetDialogValue(StringUtil.EscapeJavascriptString(mediaUrl));
                base.OnOK(sender, args);
            }
            else
            {
                SheerResponse.Eval(&amp;quot;scClose('&amp;quot; + TextEdit.Value + &amp;quot;')&amp;quot;);
            }
        }

        // Properties
        protected string Mode
        {
            get
            {
                string str = StringUtil.GetString(base.ServerProperties[&amp;quot;Mode&amp;quot;]);
                if (!string.IsNullOrEmpty(str))
                {
                    return str;
                }
                return &amp;quot;shell&amp;quot;;
            }
            set
            {
                Assert.ArgumentNotNull(value, &amp;quot;value&amp;quot;);
                base.ServerProperties[&amp;quot;Mode&amp;quot;] = value;
            }
        }
    }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Associate to this XAML form, I also have this javascript to handle the close and cancel (to only interesting method is the scClose and scCloseWebEdit). This file is located into /sitecore/shell/Controls/Rich Text Editor/TestBtn/TestBtn.js
&lt;pre name="code" class="xml"&gt;function GetDialogArguments() {
    return getRadWindow().ClientParameters;
}

function getRadWindow() {
  if (window.radWindow) {
        return window.radWindow;
  }
    
    if (window.frameElement &amp;amp;&amp;amp; window.frameElement.radWindow) {
        return window.frameElement.radWindow;
    }
    
    return null;
}

var isRadWindow = true;

var radWindow = getRadWindow();

if (radWindow) { 
  if (window.dialogArguments) { 
    radWindow.Window = window;
  } 
}


function scClose(text) {
    var returnValue = {
        text: text
    };

    getRadWindow().close(returnValue);

}

function scCancel() {
  getRadWindow().close();
}

function scCloseWebEdit(text) {
    window.returnValue = text;
    window.close();
}

if (window.focus &amp;amp;&amp;amp; Prototype.Browser.Gecko) {
  window.focus();
}&lt;/pre&gt;&lt;/p&gt;

&lt;p&gt;&lt;u&gt;UPDATE:&lt;/u&gt; &lt;br/&gt;We have found that if the command contains some special characters like ':' the button icon may be not loaded correctly. So just avoid it :-)&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/SitecoreBlog/~4/nUWYZtV0Gzk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sitecoreblog.blogspot.com/feeds/8064753433519780180/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://sitecoreblog.blogspot.com/2012/10/add-custom-button-in-rich-text-editor.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/630324887720106786/posts/default/8064753433519780180?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/630324887720106786/posts/default/8064753433519780180?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SitecoreBlog/~3/nUWYZtV0Gzk/add-custom-button-in-rich-text-editor.html" title="Add a custom button in the rich text editor" /><author><name>Vangansewinkel Benjamin</name><uri>http://www.blogger.com/profile/01696678283653731912</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="23" height="32" src="http://3.bp.blogspot.com/_Nd7hE7ZxH34/TQYjYUJJL4I/AAAAAAAAABE/TTsBcYDuEoc/S220/ben2.png" /></author><thr:total>1</thr:total><feedburner:origLink>http://sitecoreblog.blogspot.com/2012/10/add-custom-button-in-rich-text-editor.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUYFQnk6fCp7ImA9WhJaF0U.&quot;"><id>tag:blogger.com,1999:blog-630324887720106786.post-876225537236709571</id><published>2012-10-09T13:45:00.000+02:00</published><updated>2012-10-09T13:45:13.714+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-10-09T13:45:13.714+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Configuration" /><category scheme="http://www.blogger.com/atom/ns#" term="Code" /><title>Create your own pipeline</title><content type="html">As you know sitecore use a lot of pipeline but did you already try to create your own pipeline for your custom actions? 
&lt;br/&gt;
To create your own pipeline in sitecore it is easy, you will need to:
&lt;ul&gt;
  &lt;li&gt;Add your pipeline and porocessors in the web.config (or externalize it in the \app_config\include folder)
    &lt;pre name="code" class="xml"&gt;&amp;lt;configuration xmlns:patch=&amp;quot;http://www.sitecore.net/xmlconfig/&amp;quot;&amp;gt;
  &amp;lt;sitecore&amp;gt;
    &amp;lt;pipelines&amp;gt;
      &amp;lt;myCustomPipeline&amp;gt;        
        &amp;lt;processor type=&amp;quot;MyNamespace.MyProcessor, MyDll&amp;quot;&amp;gt;          
      &amp;lt;/myCustomPipeline&amp;gt;
    &amp;lt;/pipelines&amp;gt;
  &amp;lt;/sitecore&amp;gt;
&amp;lt;/configuration&amp;gt;&lt;/pre&gt;&lt;/li&gt;
  &lt;li&gt;After you may call it with this code and t will wall all the processors in this pipeline:
    &lt;pre name="code" class="xml"&gt;PipelineArgs args = new PipelineArgs();
CorePipeline.Run(&amp;quot;myCustomPipeline&amp;quot;, args);&lt;/pre&gt;&lt;/li&gt;
&lt;/ul&gt;
Simple doesn’t it?&lt;/br&gt;
You may also use your own argument if you need to pass some additional properties to the processors. To do that, you just need to create a new class who inherit from PipelineArgs.
&lt;img src="http://feeds.feedburner.com/~r/SitecoreBlog/~4/lM4BHdrd848" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sitecoreblog.blogspot.com/feeds/876225537236709571/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://sitecoreblog.blogspot.com/2012/10/create-your-own-pipeline.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/630324887720106786/posts/default/876225537236709571?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/630324887720106786/posts/default/876225537236709571?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SitecoreBlog/~3/lM4BHdrd848/create-your-own-pipeline.html" title="Create your own pipeline" /><author><name>Vangansewinkel Benjamin</name><uri>http://www.blogger.com/profile/01696678283653731912</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="23" height="32" src="http://3.bp.blogspot.com/_Nd7hE7ZxH34/TQYjYUJJL4I/AAAAAAAAABE/TTsBcYDuEoc/S220/ben2.png" /></author><thr:total>0</thr:total><feedburner:origLink>http://sitecoreblog.blogspot.com/2012/10/create-your-own-pipeline.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CU4CRHg7fSp7ImA9WhJaE0s.&quot;"><id>tag:blogger.com,1999:blog-630324887720106786.post-1565059108296591340</id><published>2012-10-04T17:19:00.001+02:00</published><updated>2012-10-04T17:19:25.605+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-10-04T17:19:25.605+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Customize Content Editor" /><title>Open an admin screen in a tab of the content editor</title><content type="html">Here is the method to open a tab in the content editor and display an aspx page in it. 
&lt;br /&gt;Here is an example:

&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-bbx3x2GLtAg/UG2oRW4pZdI/AAAAAAAAAH4/4Q2TbzynS20/s1600/Tab.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="256" src="http://2.bp.blogspot.com/-bbx3x2GLtAg/UG2oRW4pZdI/AAAAAAAAAH4/4Q2TbzynS20/s640/Tab.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;The first you will need is a command. You can add it into your command.config, or in a separate .config in \App_config\Include\.
In my example my command is named “commentandrate:opencommenteditoverview” but you can name it as you want of course.
&lt;pre class="xml" name="code"&gt;&amp;lt;configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"&amp;gt;
  &amp;lt;sitecore&amp;gt;
    &amp;lt;commands&amp;gt;
      &amp;lt;command name="commentandrate:opencommenteditoverview" type="MyNamespace.OpenCommentEditOverView, MyDllName"/&amp;gt;      
    &amp;lt;/commands&amp;gt;
  &amp;lt;/sitecore&amp;gt;
&amp;lt;/configuration&amp;gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;After that you will only need to write the corresponding class:
&lt;pre class="csharp" name="code"&gt;using Sitecore;
using Sitecore.Diagnostics;
using Sitecore.Resources;
using Sitecore.Shell.Framework.Commands;
using Sitecore.Text;
using Sitecore.Web;
using Sitecore.Web.UI.Framework.Scripts;
using Sitecore.Web.UI.Sheer;
using Sitecore.Web.UI.XamlSharp.Continuations;

namespace MyNamespace
{
    public class OpenCommentEditOverView : Command, ISupportsContinuation
    {
        // Methods
        public override void Execute(CommandContext context)
        {
            Assert.ArgumentNotNull(context, "context");
            if (context.Items.Length == 1)
            {
    //Check if the tab is already open and refresh it is needed
                if (WebUtil.GetFormValue("scEditorTabs").Contains("commentandrate:opencommenteditoverview"))
                {
                    SheerResponse.Eval("scContent.onEditorTabClick(null, null, 'OpenCommentEditOverView')");
                }
                else //Open a new tab
                {
     //The Path to the aspx file to dsplay in this tab
                    UrlString urlString = new UrlString("/sitecore/shell/Applications/LBi/CommentEditOverView.aspx");
                    context.Items[0].Uri.AddToUrlString(urlString);
                    UIUtil.AddContentDatabaseParameter(urlString);
                    //urlString["fld"] = "__Tracking";
                    SheerResponse.Eval(new ShowEditorTab
                        {
                            Command = "commentandrate:opencommenteditoverview",
                            Header = "Comments", 
                            Icon = Images.GetThemedImageSource("Network/16x16/lock.png"), 
                            Url = urlString.ToString(), 
                            Id = "OpenCommentEditOverView", 
                            Closeable = true
                        }.ToString());
                }
            }
        }

    }
}&lt;/pre&gt;
&lt;/li&gt;
&lt;/ol&gt;
That is it for the command and the code itself but of course you will need a way to call the command. &lt;br /&gt;
You can for example add a button in a toolbar. &lt;br /&gt;If you don’t know what is a chunk, a strip, … please refer to this post: http://sitecoreblog.blogspot.be/2010/11/use-contextual-button.html 

&lt;br /&gt;
&lt;br /&gt;
To create this new button:&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Switch to the core database&lt;/li&gt;
&lt;li&gt;In /sitecore/content/Applications/Content Editor/Ribbons/Chunks, add a new “Chunk” (template: /sitecore/templates/System/Ribbon/Chunk)&lt;/li&gt;
&lt;li&gt;Fill in the fields:
  &lt;ol&gt;
&lt;li&gt;Header: The name who will appear below the block of button&lt;/li&gt;
&lt;li&gt;ID: an ID&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;Below this chunk, add a new item of type /sitecore/templates/System/Ribbon/Large Button&lt;/li&gt;
&lt;li&gt;Fill in the fields:
  &lt;ol&gt;
&lt;li&gt;Header: The name who will appear below the block of button&lt;/li&gt;
&lt;li&gt;Icon: The icon of this button&lt;/li&gt;
&lt;li&gt;Click: you command name (as in the .config)&lt;/li&gt;
&lt;li&gt;Tooltip: the text when you let the mouse on this button&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;To include this chunk in the “Home” toolbar, go in /sitecore/content/Applications/Content Editor/Ribbons/Strips/Home&lt;/li&gt;
&lt;li&gt;Add a new subitem (template: /sitecore/templates/System/Reference)&lt;/li&gt;
&lt;li&gt;And fill in the Reference field (example of value: sitecore/content/Applications/Content Editor/Ribbons/Chunks/Comment Rate Admin)&lt;/li&gt;
&lt;/ol&gt;
&lt;img src="http://feeds.feedburner.com/~r/SitecoreBlog/~4/L18OEaEGx8o" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sitecoreblog.blogspot.com/feeds/1565059108296591340/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://sitecoreblog.blogspot.com/2012/10/open-admin-screen-in-tab-of-content.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/630324887720106786/posts/default/1565059108296591340?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/630324887720106786/posts/default/1565059108296591340?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SitecoreBlog/~3/L18OEaEGx8o/open-admin-screen-in-tab-of-content.html" title="Open an admin screen in a tab of the content editor" /><author><name>Vangansewinkel Benjamin</name><uri>http://www.blogger.com/profile/01696678283653731912</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="23" height="32" src="http://3.bp.blogspot.com/_Nd7hE7ZxH34/TQYjYUJJL4I/AAAAAAAAABE/TTsBcYDuEoc/S220/ben2.png" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-bbx3x2GLtAg/UG2oRW4pZdI/AAAAAAAAAH4/4Q2TbzynS20/s72-c/Tab.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://sitecoreblog.blogspot.com/2012/10/open-admin-screen-in-tab-of-content.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEIERX06fip7ImA9WhNSEUg.&quot;"><id>tag:blogger.com,1999:blog-630324887720106786.post-5963244057762483574</id><published>2012-10-04T16:40:00.001+02:00</published><updated>2012-10-25T11:15:04.316+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-10-25T11:15:04.316+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="VS" /><title>The most useful shortcut for VS 2010</title><content type="html">UPDATE: For visual studio 2012, you may install the great extension "AttachTo" via the "Extension and Update" of visaul studio.


Here is maybe the most useful keyboard shortcut you can create in visual studio for the web development.&lt;br /&gt;
Don’t you have dream to push on one shortcut only to attach to the w3wp process without accept all the dialog boxes?&lt;br /&gt;
This is the equivalent of pushing on ctrl+alt+p (open attach to process window), w (go to the letter w), enter (to accept to attach). &lt;br /&gt;
&lt;br /&gt;
Here is the method to do that with only one key combination:&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Click on “View” – “Other windows” – “Macro Explorer” (or alt+F8)&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-tfjkNrew3No/UG2ehgPedUI/AAAAAAAAAHY/B5RK97sCfVw/s1600/Macro_window.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://4.bp.blogspot.com/-tfjkNrew3No/UG2ehgPedUI/AAAAAAAAAHY/B5RK97sCfVw/s320/Macro_window.png" width="319" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;Right click on “MyMacros” – “New Module”&lt;/li&gt;
&lt;li&gt;Name it “MyCustomMacros” for example and click on “Add”&lt;/li&gt;
&lt;li&gt;Replace the content of the file by:&lt;br /&gt;
&lt;pre class="csharp" name="code"&gt;Imports System
Imports EnvDTE
Imports EnvDTE80
Imports EnvDTE90
Imports EnvDTE90a
Imports EnvDTE100
Imports System.Diagnostics

Public Module MyCustomMacros

    ' This subroutine attaches to calc.exe if it is running.
    Sub AttachToW3WP()
        Dim attached As Boolean = False
        Dim proc As EnvDTE.Process

        For Each proc In DTE.Debugger.LocalProcesses
            If (Right(proc.Name, 8) = "w3wp.exe") Then
                proc.Attach()
                attached = True
                'Exit For
            End If
        Next

        If attached = False Then
            MsgBox("Could not find w3wp")
        End If

    End Sub
End Module
&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;Right click on the toolbar zone (on the left of “help” for example) and select the latest option: “Customize…”&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-0I5xz1hoGsw/UG2evkwMH0I/AAAAAAAAAHg/Z0HlXPXmI4Y/s1600/CuustomizeKeyboard.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://4.bp.blogspot.com/-0I5xz1hoGsw/UG2evkwMH0I/AAAAAAAAAHg/Z0HlXPXmI4Y/s320/CuustomizeKeyboard.png" width="311" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;Click on the “Keyboard…” button&lt;/li&gt;
&lt;li&gt;In the “Show commands containing” search for “w3w” for example&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/--ilPgKEOgcI/UG2e57aSEOI/AAAAAAAAAHo/fEHRMKzTB64/s1600/Assign_shortcut.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="267" src="http://3.bp.blogspot.com/--ilPgKEOgcI/UG2e57aSEOI/AAAAAAAAAHo/fEHRMKzTB64/s400/Assign_shortcut.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;Select the new macro and in the “Press shortcut keys” box type a shortcut. Don’t forget to push on “Assign”&lt;/li&gt;
&lt;/ol&gt;
&lt;img src="http://feeds.feedburner.com/~r/SitecoreBlog/~4/M_ImS2N10MY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sitecoreblog.blogspot.com/feeds/5963244057762483574/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://sitecoreblog.blogspot.com/2012/10/the-most-useful-shortcut-for-vs2012.html#comment-form" title="4 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/630324887720106786/posts/default/5963244057762483574?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/630324887720106786/posts/default/5963244057762483574?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SitecoreBlog/~3/M_ImS2N10MY/the-most-useful-shortcut-for-vs2012.html" title="The most useful shortcut for VS 2010" /><author><name>Vangansewinkel Benjamin</name><uri>http://www.blogger.com/profile/01696678283653731912</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="23" height="32" src="http://3.bp.blogspot.com/_Nd7hE7ZxH34/TQYjYUJJL4I/AAAAAAAAABE/TTsBcYDuEoc/S220/ben2.png" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-tfjkNrew3No/UG2ehgPedUI/AAAAAAAAAHY/B5RK97sCfVw/s72-c/Macro_window.png" height="72" width="72" /><thr:total>4</thr:total><feedburner:origLink>http://sitecoreblog.blogspot.com/2012/10/the-most-useful-shortcut-for-vs2012.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUEDQX4yfip7ImA9WhJXGE4.&quot;"><id>tag:blogger.com,1999:blog-630324887720106786.post-9104715167158512561</id><published>2012-08-13T08:01:00.000+02:00</published><updated>2012-08-13T08:01:10.096+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-08-13T08:01:10.096+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Webservices" /><category scheme="http://www.blogger.com/atom/ns#" term="Code" /><title>Use the sitecore webservice</title><content type="html">Recently, I have used the sitecore webservices for the first time to run some jobs without the sitecore context.
&lt;br /&gt;
If you plan to use it, you will need to choose between the sitecore webservice or the sitecore rocks webservice.&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;The sitecore webservice &lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;span style="color: #93c47d;"&gt;+&lt;/span&gt;&lt;/strong&gt; Included in sitecore by default &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;+&lt;/span&gt;&lt;/strong&gt; Secured (you need to pass some credentials to execute the methods)&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;span style="color: red;"&gt;–&lt;/span&gt;&lt;/strong&gt; Very basic&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;The sitecore rocks webservice
&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;span style="color: #93c47d;"&gt;+&lt;/span&gt;&lt;/strong&gt; Include all feature from the basic one and add some functionalities
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;+&lt;/span&gt;&lt;/strong&gt; Secured (you need to pass some credentials to execute the methods)
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;span style="color: red;"&gt;–&lt;/span&gt;&lt;/strong&gt; Need to add the webservice before using in (not by default in sitecore but it is only 2-3 files to copy)&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
To use the webservice you need to:
&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Create a reference to your webservice into your project&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Sitecore WS: &lt;a href="http://[HOSTNAME]/sitecore/shell/Webservice/Service.asmx" target="_blank"&gt;http://[HOSTNAME]/sitecore/shell/Webservice/Service.asmx&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Rocks WS: &lt;a href="http://[HOSTNAME]/sitecore/shell/Webservice/Service2.asmx" target="_blank"&gt;http://[HOSTNAME]/sitecore/shell/Webservice/Service2.asmx&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Create some credentials
&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Sitecore WS: &lt;pre class="csharp" name="code"&gt;OldWS.Credentials oldCredentials = new OldWS.Credentials();
oldCredentials.UserName = @"sitecore\admin";
oldCredentials.Password = "b";&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;Rocks WS: &lt;pre class="csharp" name="code"&gt;RocksWS.Credentials credentials = new RocksWS.Credentials();
credentials.UserName = @"sitecore\admin";
credentials.Password = "b";&lt;/pre&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Create an instance of the webservice
&lt;ul&gt;
&lt;li&gt;Sitecore WS &lt;pre class="csharp" name="code"&gt;OldWS.VisualSitecoreServiceSoapClient oldWs = new OldWS.VisualSitecoreServiceSoapClient();&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;Rocks WS &lt;pre class="csharp" name="code"&gt;RocksWS.SitecoreWebService2SoapClient ws = new RocksWS.SitecoreWebService2SoapClient();&lt;/pre&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Use the methods of the webservice for example 
&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;GetChildren:
&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Sitecore WS &lt;pre class="csharp" name="code"&gt;//The parent item
const string dictionaryId = "{504AE189-9F36-4C62-9767-66D73D6C3084}";
var dictionaryChildren = oldWs.GetChildren(dictionaryId, "master", OldCredentials);&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;Rocks WS &lt;pre class="csharp" name="code"&gt;//The parent item
const string dictionaryId = "{504AE189-9F36-4C62-9767-66D73D6C3084}";
var dictionaryChildren = Ws.GetChildren(dictionaryId, "master", Credentials);&lt;/pre&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;/ol&gt;
Here is the official sitecore documentation: &lt;a href="http://sdn.sitecore.net/Reference/Sitecore%206/Sitecore%20Web%20Service%20Reference.aspx"&gt;http://sdn.sitecore.net/Reference/Sitecore%206/Sitecore%20Web%20Service%20Reference.aspx&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/SitecoreBlog/~4/Dr-I4CL5y-M" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sitecoreblog.blogspot.com/feeds/9104715167158512561/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://sitecoreblog.blogspot.com/2012/08/use-sitecore-webservice.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/630324887720106786/posts/default/9104715167158512561?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/630324887720106786/posts/default/9104715167158512561?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SitecoreBlog/~3/Dr-I4CL5y-M/use-sitecore-webservice.html" title="Use the sitecore webservice" /><author><name>Vangansewinkel Benjamin</name><uri>http://www.blogger.com/profile/01696678283653731912</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="23" height="32" src="http://3.bp.blogspot.com/_Nd7hE7ZxH34/TQYjYUJJL4I/AAAAAAAAABE/TTsBcYDuEoc/S220/ben2.png" /></author><thr:total>0</thr:total><feedburner:origLink>http://sitecoreblog.blogspot.com/2012/08/use-sitecore-webservice.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUANSH0ycCp7ImA9WhJaGUk.&quot;"><id>tag:blogger.com,1999:blog-630324887720106786.post-686937970090347910</id><published>2012-07-27T11:43:00.002+02:00</published><updated>2012-10-11T11:29:59.398+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-10-11T11:29:59.398+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Webform For Marketers" /><title>WFFM - Use a display name for the email in the send action</title><content type="html">To "Send Email Message" save action of webform for marketers you may change the field "Parameters" in the item: /sitecore/system/Modules/Web Forms for Marketers/Settings/Actions/Save Actions/Send Email Message.&lt;br /&gt;
&lt;br /&gt;
The default value is:
&lt;br /&gt;
&lt;pre class="xml" name="code"&gt;&amp;lt;Host&amp;gt;example.host&amp;lt;/Host&amp;gt;&amp;lt;From&amp;gt;example@mail.net&amp;lt;/From&amp;gt;&amp;lt;IsBodyHtml&amp;gt;true&amp;lt;/IsBodyHtml&amp;gt;&lt;/pre&gt;
Now, if you need to have a different display name for the "from" than just dispaly the email itself you can just add the display name in double quotes before the email like this:&lt;br /&gt;
&lt;pre class="xml" name="code"&gt;&amp;lt;Host&amp;gt;example.host&amp;lt;/Host&amp;gt;&amp;lt;From&amp;gt;"My Display Name" example@mail.net&amp;lt;/From&amp;gt;&amp;lt;IsBodyHtml&amp;gt;true&amp;lt;/IsBodyHtml&amp;gt;&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/SitecoreBlog/~4/XlzJJqf61Dk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sitecoreblog.blogspot.com/feeds/686937970090347910/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://sitecoreblog.blogspot.com/2012/07/wfm-use-display-name-for-email-in-send.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/630324887720106786/posts/default/686937970090347910?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/630324887720106786/posts/default/686937970090347910?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SitecoreBlog/~3/XlzJJqf61Dk/wfm-use-display-name-for-email-in-send.html" title="WFFM - Use a display name for the email in the send action" /><author><name>Vangansewinkel Benjamin</name><uri>http://www.blogger.com/profile/01696678283653731912</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="23" height="32" src="http://3.bp.blogspot.com/_Nd7hE7ZxH34/TQYjYUJJL4I/AAAAAAAAABE/TTsBcYDuEoc/S220/ben2.png" /></author><thr:total>0</thr:total><feedburner:origLink>http://sitecoreblog.blogspot.com/2012/07/wfm-use-display-name-for-email-in-send.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkYGSXoyfyp7ImA9WhJRFEw.&quot;"><id>tag:blogger.com,1999:blog-630324887720106786.post-4210543513879313502</id><published>2012-07-16T07:55:00.001+02:00</published><updated>2012-07-16T07:55:28.497+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-07-16T07:55:28.497+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Configuration" /><category scheme="http://www.blogger.com/atom/ns#" term="Code" /><title>Create a custom remote event in sitecore - Demo</title><content type="html">I have multiple comments on &lt;a href="http://sitecoreblog.blogspot.be/2011/06/create-custom-remote-event-in-sitecore.html"&gt;the post about the custom remote events&lt;/a&gt;, so I will give you a more complete example. If you need more information about how those events work please refer to the previous post.&lt;br /&gt;
&lt;br /&gt;
You can download the full exaple as a &lt;a href="http://multiupload.biz/k7mah3iz4vec/CustomEvents_MultiUpload.biz.zip.html" target="_blank"&gt;zip file here&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
In this example, I have also added a parameter in the event.&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;The event:
&lt;pre class="csharp" name="code"&gt;using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace BOL.Events
{
    [DataContract]
    public class ClearCacheEvent
    {
        public ClearCacheEvent(string cacheName)
        {
            this.CacheName = cacheName;
        }

        // Properties
        [DataMember]
        public string CacheName { get; protected set; }

    }
}&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;The event argument with the parameter:
&lt;pre class="csharp" name="code"&gt;using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Sitecore.Events;

namespace BOL.Events
{
    [Serializable]
    public class ClearCacheEventArgs : EventArgs, IPassNativeEventArgs
    {
        public string CacheName { get; set; }

        public ClearCacheEventArgs(string cacheName)
        {
            this.CacheName = cacheName;
        }
    }
}
&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;The event handler:
&lt;pre class="csharp" name="code"&gt;using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Sitecore.Diagnostics;
using Sitecore.Events;

namespace BOL.Events
{
    public class ClearCacheEventHandler
    {
        /// &lt;summary&gt;
        /// This methos is used to raise the local event
        /// &lt;/summary&gt;
        /// 
        public static void Run(ClearCacheEvent @event)
        {
            Log.Info("ClearCacheEventHandler - Run", typeof(ClearCacheEventHandler));
            ClearCacheEventArgs args = new ClearCacheEventArgs(@event.CacheName);
            Event.RaiseEvent("clearcache:remote", new object[] { args });
        }
    }
}&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;The hook to register the event:
&lt;pre class="csharp" name="code"&gt;using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Sitecore.Events.Hooks;

namespace BOL.Events
{
    public class ClearCacheHook : IHook
    {
        public void Initialize()
        {
            Sitecore.Eventing.EventManager.Subscribe&lt;clearcacheevent&gt;(new Action&lt;clearcacheevent&gt;(ClearCacheEventHandler.Run));
        }
    }
}
&lt;/clearcacheevent&gt;&lt;/clearcacheevent&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;The code to trigger the event:
&lt;pre class="csharp" name="code"&gt;public class TriggerEvent
{
 public void Trigger()
 {
  ClearCacheEvent inst = new ClearCacheEvent("Navigation");
  Sitecore.Eventing.EventManager.QueueEvent&lt;clearcacheevent&gt;(inst);
 }
}&lt;/clearcacheevent&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;The config file to register the event:
&lt;pre class="csharp" name="code"&gt;&amp;lt;configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"&amp;gt;
  &amp;lt;sitecore&amp;gt;
 &amp;lt;hooks&amp;gt;  
  &amp;lt;hook type="BOL.Events.ClearCacheHook, BOL"/&amp;gt;  
 &amp;lt;/hooks&amp;gt; 
 
 &amp;lt;events&amp;gt;
  &amp;lt;event name="clearcache:remote"&amp;gt;
   &amp;lt;handler type="Shurgard.Events.ClearStoreCache, Shurgard.Events" method="OnRemoteClearStoreCache"/&amp;gt;          
  &amp;lt;/event&amp;gt;
 &amp;lt;events&amp;gt;
 
  &amp;lt;/sitecore&amp;gt;
&amp;lt;/configuration&amp;gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;&lt;img src="http://feeds.feedburner.com/~r/SitecoreBlog/~4/MEQ0bCN4jbc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sitecoreblog.blogspot.com/feeds/4210543513879313502/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://sitecoreblog.blogspot.com/2012/07/create-custom-remote-event-in-sitecore.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/630324887720106786/posts/default/4210543513879313502?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/630324887720106786/posts/default/4210543513879313502?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SitecoreBlog/~3/MEQ0bCN4jbc/create-custom-remote-event-in-sitecore.html" title="Create a custom remote event in sitecore - Demo" /><author><name>Vangansewinkel Benjamin</name><uri>http://www.blogger.com/profile/01696678283653731912</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="23" height="32" src="http://3.bp.blogspot.com/_Nd7hE7ZxH34/TQYjYUJJL4I/AAAAAAAAABE/TTsBcYDuEoc/S220/ben2.png" /></author><thr:total>0</thr:total><feedburner:origLink>http://sitecoreblog.blogspot.com/2012/07/create-custom-remote-event-in-sitecore.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkEAQ3w9eip7ImA9WhJSGE4.&quot;"><id>tag:blogger.com,1999:blog-630324887720106786.post-5736744003805084181</id><published>2012-07-09T14:43:00.000+02:00</published><updated>2012-07-09T14:57:22.262+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-07-09T14:57:22.262+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Modules" /><title>Image Extension Module</title><content type="html">I have&amp;nbsp;release a new module on trac. This module is an extension of the sitecore control &amp;lt;sc:Image /&amp;gt; who add 2 possibilities:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Use the real file extension in place of the .ashx used by sitecore. (This functionality is better for the SEO but also allow you to apply a transparency filter on IE6 to your PNG files.)
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-TJSiPMAr4ws/T_rTx6ZUXxI/AAAAAAAAAHA/IfY9L86PECQ/s1600/2012-07-09_1450.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="72" src="http://1.bp.blogspot.com/-TJSiPMAr4ws/T_rTx6ZUXxI/AAAAAAAAAHA/IfY9L86PECQ/s640/2012-07-09_1450.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;Set a default image who will appear when the image field is empty. This setting is configurable at two level: on the site level and control per control.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-HQLvnG3CR5o/T_rTqpHDF6I/AAAAAAAAAG4/_3NoX1Csytk/s1600/no_photo.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-HQLvnG3CR5o/T_rTqpHDF6I/AAAAAAAAAG4/_3NoX1Csytk/s1600/no_photo.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;
For the documentation of this module click &lt;a href="http://trac.sitecore.net/ImageExtension/browser/Trunk/Documentation/ImageExtension.docx" target="_blank"&gt;here&lt;/a&gt;.&lt;img src="http://feeds.feedburner.com/~r/SitecoreBlog/~4/MgHr1Fiaieo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sitecoreblog.blogspot.com/feeds/5736744003805084181/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://sitecoreblog.blogspot.com/2012/07/image-extension-module.html#comment-form" title="4 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/630324887720106786/posts/default/5736744003805084181?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/630324887720106786/posts/default/5736744003805084181?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SitecoreBlog/~3/MgHr1Fiaieo/image-extension-module.html" title="Image Extension Module" /><author><name>Vangansewinkel Benjamin</name><uri>http://www.blogger.com/profile/01696678283653731912</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="23" height="32" src="http://3.bp.blogspot.com/_Nd7hE7ZxH34/TQYjYUJJL4I/AAAAAAAAABE/TTsBcYDuEoc/S220/ben2.png" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-TJSiPMAr4ws/T_rTx6ZUXxI/AAAAAAAAAHA/IfY9L86PECQ/s72-c/2012-07-09_1450.png" height="72" width="72" /><thr:total>4</thr:total><feedburner:origLink>http://sitecoreblog.blogspot.com/2012/07/image-extension-module.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEIHQn8zfyp7ImA9WhJTE0g.&quot;"><id>tag:blogger.com,1999:blog-630324887720106786.post-3641650899587336717</id><published>2012-06-22T09:56:00.000+02:00</published><updated>2012-06-22T10:08:53.187+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-06-22T10:08:53.187+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Shared Source" /><category scheme="http://www.blogger.com/atom/ns#" term="Modules" /><title>Sublayout Queryable Datasource module on trac</title><content type="html">I have release a new module on trac. This one allow you to select the datasource dynamically with a XPath query in the dialog open when you insert a sublayout in webedit mode.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;object class="BLOGGER-youtube-video" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" data-thumbnail-src="http://i.ytimg.com/vi/n8qIQcffZzM/0.jpg" height="266" width="320"&gt;&lt;param name="movie" value="http://www.youtube.com/v/n8qIQcffZzM?version=3&amp;f=user_uploads&amp;c=google-webdrive-0&amp;app=youtube_gdata" /&gt;


&lt;param name="bgcolor" value="#FFFFFF" /&gt;


&lt;param name="allowFullScreen" value="true" /&gt;


&lt;embed width="640" height="532"  src="http://www.youtube.com/v/n8qIQcffZzM?version=3&amp;f=user_uploads&amp;c=google-webdrive-0&amp;app=youtube_gdata" type="application/x-shockwave-flash" allowfullscreen="true"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;
If you don't like the video version here is a small description of this module.


&lt;br /&gt;
&lt;h2&gt;
Purpose&lt;/h2&gt;
If you have a multisite solution and if you want to use the field "Datasource Location" and "Datasource template" on you sublayout to open the datasource selection dialog when you add this sublayout on your page in page edit mode, you are not able to select the folder dynamically. by default sitecore only allow to select a folder like /sitecore/content/MyDatas. 

The idea of this module is to enable the possibility to select this folder relatively to the current item with an XPath query as you do in the fields for example.



After installing this module you will be able to select this folder with a query syntaxt like this one for example: 
&lt;br /&gt;
&lt;pre class="sql" name="code"&gt;query:ancestor-or-self::*[@@templatename = 'Website Root']/Data/Demo
&lt;/pre&gt;
&lt;h2&gt;
How to Install?&lt;/h2&gt;
&lt;ul&gt;&lt;li&gt;You can download package from &lt;a href="http://trac.sitecore.net/SublayoutQueryableDatasource/export/4/Trunk/Packages/SublayoutQueryableDatasource-1.0.zip" target="_blank"&gt;here&lt;/a&gt;.&lt;/li&gt; 
&lt;li&gt;Install it with the sitecore installation tool in the desktop of sitecore 
&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;
&lt;h2&gt;
Next steps&lt;/h2&gt;
If you have any issues or suggestions for the Sublayout Queryable Datasource module, please report it by posting a comment on this post.&lt;img src="http://feeds.feedburner.com/~r/SitecoreBlog/~4/jN9H5Yw2FLk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sitecoreblog.blogspot.com/feeds/3641650899587336717/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://sitecoreblog.blogspot.com/2012/06/sublayout-queryable-datasource-module.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/630324887720106786/posts/default/3641650899587336717?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/630324887720106786/posts/default/3641650899587336717?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SitecoreBlog/~3/jN9H5Yw2FLk/sublayout-queryable-datasource-module.html" title="Sublayout Queryable Datasource module on trac" /><author><name>Vangansewinkel Benjamin</name><uri>http://www.blogger.com/profile/01696678283653731912</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="23" height="32" src="http://3.bp.blogspot.com/_Nd7hE7ZxH34/TQYjYUJJL4I/AAAAAAAAABE/TTsBcYDuEoc/S220/ben2.png" /></author><thr:total>1</thr:total><feedburner:origLink>http://sitecoreblog.blogspot.com/2012/06/sublayout-queryable-datasource-module.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CE8CSXk4fCp7ImA9WhJTE0g.&quot;"><id>tag:blogger.com,1999:blog-630324887720106786.post-8796578614744391858</id><published>2012-06-18T08:18:00.000+02:00</published><updated>2012-06-22T10:14:28.734+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-06-22T10:14:28.734+02:00</app:edited><title>Datasources queryable</title><content type="html">&lt;strong&gt;[EDIT] I have release a new module on trac to do that so it will be easier to use this module. For more information take a look at this post:&lt;a href="http://sitecoreblog.blogspot.be/2012/06/sublayout-queryable-datasource-module.html" target="_blank"&gt; http://sitecoreblog.blogspot.be/2012/06/sublayout-queryable-datasource-module.html&lt;/a&gt;[/EDIT]&lt;/strong&gt;

&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the &lt;a href="http://www.sitecoreug.org/events/The-Sitecore-Page-Editor"&gt;video from Nick Wesselman at the sitecore virtual user group&lt;/a&gt;, he show how to use a subitem as a datasource for a sublayout. 

&lt;br /&gt;
&lt;br /&gt;
The datasource is used when you insert a sublayout in webedit mode to display a popup to select an create if needed the datasource of this sublayout.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-nYgqhejCO0A/T97ELvURB8I/AAAAAAAAAGg/V2c8vzFestM/s1600/2012-06-18_0736.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://2.bp.blogspot.com/-nYgqhejCO0A/T97ELvURB8I/AAAAAAAAAGg/V2c8vzFestM/s320/2012-06-18_0736.png" width="306" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
The problem happend when you have a multisite solution for example because with the system from sitecore you cannot set a relative datasource. The idea was to enable the possbility to set this datasource using a query as in the fields.&lt;br /&gt;
&lt;br /&gt;
To code for this is very simple:&lt;br /&gt;
&lt;pre class="csharp" name="code"&gt;public class SublayoutQueryableDatasource
{
    public void Process(GetRenderingDatasourceArgs args) 
    {
        Assert.IsNotNull(args, "args");

        string text = args.RenderingItem["Datasource Location"]; //Get the value from the field
        if (!string.IsNullOrEmpty(text))
        {
            if (text.StartsWith("query:") &amp;amp;&amp;amp; !string.IsNullOrEmpty(args.ContextItemPath))
            {
                var contextItem = args.ContentDatabase.GetItem(args.ContextItemPath);

                if (contextItem != null)
                {
                    text = text.Remove(0, 6); //remove the query:
                    var item = contextItem.Axes.SelectSingleItem(text); //Execute the query

                    if (item != null)
                    {
                        args.DatasourceRoots.Add(item);
                    }
                }
            }
        }
    }
}&lt;/pre&gt;
&lt;br /&gt;
After that you just have to included this pipeline in the correct place by adding this into a file in your /app_Config/Include folder:&lt;br /&gt;
&lt;pre class="csharp" name="code"&gt;&amp;lt;configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"&amp;gt;
  &amp;lt;sitecore&amp;gt;
    &amp;lt;pipelines&amp;gt;
      &amp;lt;getRenderingDatasource&amp;gt;
        &amp;lt;processor type="YOURNAMESPACE.SublayoutQueryableDatasource, YOURNAMESPACE"
                   patch:before="processor[@type='Sitecore.Pipelines.GetRenderingDatasource.GetDatasourceLocation, Sitecore.Kernel']"/&amp;gt;
      &amp;lt;/getRenderingDatasource&amp;gt;
    &amp;lt;/pipelines&amp;gt;
  &amp;lt;/sitecore&amp;gt;
&amp;lt;/configuration&amp;gt;&lt;/pre&gt;
&lt;br /&gt;
After that you are able to set the datasource like this:&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-yvGQv4IUAv8/T97HjaY_LiI/AAAAAAAAAGs/cem2IROoW6E/s1600/2012-06-18_0810.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="79" src="http://1.bp.blogspot.com/-yvGQv4IUAv8/T97HjaY_LiI/AAAAAAAAAGs/cem2IROoW6E/s640/2012-06-18_0810.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;img src="http://feeds.feedburner.com/~r/SitecoreBlog/~4/C-UyW_89Y0k" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sitecoreblog.blogspot.com/feeds/8796578614744391858/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://sitecoreblog.blogspot.com/2012/06/datasources-queryable.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/630324887720106786/posts/default/8796578614744391858?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/630324887720106786/posts/default/8796578614744391858?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SitecoreBlog/~3/C-UyW_89Y0k/datasources-queryable.html" title="Datasources queryable" /><author><name>Vangansewinkel Benjamin</name><uri>http://www.blogger.com/profile/01696678283653731912</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="23" height="32" src="http://3.bp.blogspot.com/_Nd7hE7ZxH34/TQYjYUJJL4I/AAAAAAAAABE/TTsBcYDuEoc/S220/ben2.png" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-nYgqhejCO0A/T97ELvURB8I/AAAAAAAAAGg/V2c8vzFestM/s72-c/2012-06-18_0736.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://sitecoreblog.blogspot.com/2012/06/datasources-queryable.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0UBSXgycCp7ImA9WhVbEkU.&quot;"><id>tag:blogger.com,1999:blog-630324887720106786.post-3531309840249237736</id><published>2012-05-29T11:54:00.000+02:00</published><updated>2012-05-29T11:54:18.698+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-05-29T11:54:18.698+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Admin and Security" /><title>Reset the admin passord</title><content type="html">To reset the '&lt;em&gt;admin&lt;/em&gt;' password to '&lt;em&gt;b&lt;/em&gt;' the easest way is to execute this SQL script on the core database:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sql" name="code"&gt;
UPDATE [aspnet_Membership] SET Password='qOvF8m8F2IcWMvfOBjJYHmfLABc=' &lt;br /&gt;WHERE UserId IN (SELECT UserId FROM [aspnet_Users] WHERE UserName = 'sitecore\Admin')&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/SitecoreBlog/~4/IWDK8W62_iw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sitecoreblog.blogspot.com/feeds/3531309840249237736/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://sitecoreblog.blogspot.com/2012/05/reset-admin-passord.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/630324887720106786/posts/default/3531309840249237736?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/630324887720106786/posts/default/3531309840249237736?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SitecoreBlog/~3/IWDK8W62_iw/reset-admin-passord.html" title="Reset the admin passord" /><author><name>Vangansewinkel Benjamin</name><uri>http://www.blogger.com/profile/01696678283653731912</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="23" height="32" src="http://3.bp.blogspot.com/_Nd7hE7ZxH34/TQYjYUJJL4I/AAAAAAAAABE/TTsBcYDuEoc/S220/ben2.png" /></author><thr:total>0</thr:total><feedburner:origLink>http://sitecoreblog.blogspot.com/2012/05/reset-admin-passord.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkMBRXk4eSp7ImA9WhVXFUs.&quot;"><id>tag:blogger.com,1999:blog-630324887720106786.post-4205685071051249202</id><published>2012-04-16T10:20:00.002+02:00</published><updated>2012-04-16T10:20:54.731+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-04-16T10:20:54.731+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Customize Content Editor" /><title>How to create a custom Multilist field not related to the items</title><content type="html">Sometimes you need to create any fields who list and store some values but you don’t have any sitecore items related to those values. For example, in one of our projects we have a list of categories who come from a webservice.&lt;br /&gt;
&lt;br /&gt;
To do that easily, I have created a base class that you can download &lt;a href="https://docs.google.com/open?id=0BxspBwpcyZCRbkdQZnc2QTNENzA"&gt;here&lt;/a&gt;&lt;br /&gt;
(the code of this file is also at the bottom of this post)&lt;br /&gt;
&lt;br /&gt;
After that you need to impelemnt your field by creating a new class who will inherit from my base class. Here is the skeleton of this class.
&lt;br /&gt;
&lt;pre class="csharp" name="code"&gt;public class Test : MultilistExBase
{
 protected override void InitRendering()
 {
  //You can Initialise some variables here.
 }

 protected override IEnumerable&amp;lt;KeyValuePair&amp;lt;string, string&amp;gt;&amp;gt; GetNonSelectedItems()
 {
  //Return here your unselected items. First value is the ID you will store into your field, the second one is the display text.
 }

 protected override IEnumerable&amp;lt;KeyValuePair&amp;lt;string, string&amp;gt;&amp;gt; GetSelectedItems()
 {
  //Return here your selected items. First value is the ID you will store into your field, the second one is the display text.
 }
}&lt;/pre&gt;
You need to implement only  3 methods :
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;InitRendering: Allow you to initialize your variables, webservice, ...&lt;/li&gt;
&lt;li&gt;GetNonSelectedItems: You need to return the list of unselected items&lt;/li&gt;
&lt;li&gt;GetSelectedItems: You need to return the list of selected items&lt;/li&gt;
&lt;/ul&gt;
As you can see the items are only a KeyValuePair&lt;string, string=""&gt; where the key is the id stored into the sitecore field and the value is the display text. With this method you can really have the control of what is stored and display into the field.&lt;/string,&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;To create your customfield into sitecore you need:
- Register your namespace in the &lt;controlsources&gt; tag of your .config file
&lt;/controlsources&gt;&lt;br /&gt;
&lt;pre class="xml" name="code"&gt;&amp;lt;controlSources&amp;gt;
      &amp;lt;source mode="on" namespace="MyNamespace" assembly="MyAssembly" prefix="myControls"/&amp;gt;
&amp;lt;/controlSources&amp;gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;Create a new item based on the /sitecore/templates/System/Templates/Template field type in the core database below /sitecore/system/Field types/List Types&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-hedBgmeDOH8/T4vPYiFjgzI/AAAAAAAAAGE/UKARPf70j3Y/s1600/2012-04-16_0859.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="416" src="http://2.bp.blogspot.com/-hedBgmeDOH8/T4vPYiFjgzI/AAAAAAAAAGE/UKARPf70j3Y/s640/2012-04-16_0859.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-2z3dd6f-EEk/T4vPBgPc6rI/AAAAAAAAAF0/5e1jbfW2w9s/s1600/2012-04-16_0907.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
After that you will have a field like:&lt;br /&gt;
&lt;a href="http://1.bp.blogspot.com/-2z3dd6f-EEk/T4vPBgPc6rI/AAAAAAAAAF0/5e1jbfW2w9s/s1600/2012-04-16_0907.png" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="171" src="http://1.bp.blogspot.com/-2z3dd6f-EEk/T4vPBgPc6rI/AAAAAAAAAF0/5e1jbfW2w9s/s640/2012-04-16_0907.png" width="640" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-UIoXZfUVV8M/T4vPLKRBpWI/AAAAAAAAAF8/SSYyY_CxuXc/s1600/2012-04-16_0908.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;
But you can see that you can handle the raw value as I want: &lt;a href="http://1.bp.blogspot.com/-UIoXZfUVV8M/T4vPLKRBpWI/AAAAAAAAAF8/SSYyY_CxuXc/s1600/2012-04-16_0908.png" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="40" src="http://1.bp.blogspot.com/-UIoXZfUVV8M/T4vPLKRBpWI/AAAAAAAAAF8/SSYyY_CxuXc/s640/2012-04-16_0908.png" width="640" /&gt;&lt;/a&gt;&lt;br /&gt;
If you want to be complete, you can also create the field who will be used into your code to retrieve the content of your field (as you use the fields from Sitecore.Data.Fields). The most important method here it the GetAvailableFields() method where you need to return the list of objects corresponding to the raw value.
&lt;br /&gt;
&lt;pre class="csharp" name="code"&gt;public class TestField : DelimitedField
{
 // Methods
 public TestField(Field innerField)
  : base(innerField, '|')
 {
 }

 public List&amp;lt;MyObject&amp;gt; GetAvailableFields()
 {
  //Return the list of object corresponding to the raw value
  List&amp;lt;MyObject&amp;gt; lst = new List&amp;lt;MyObject&amp;gt;(); 
  foreach (var item in this.Items)
  {
   lst.Add(new MyObject(item));
  }
  return lst;
 }

 public static implicit operator TestField(Field field)
 {
  if (field != null)
  {
   return new TestField(field);
  }
  return null;
 }
}&lt;/pre&gt;
&lt;br/&gt;
&lt;br/&gt;

Here is the source code of my base class:
&lt;pre class="csharp" name="code"&gt;using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Sitecore.Shell.Applications.ContentEditor;
using Sitecore.Diagnostics;
using Sitecore.Data.Items;
using System.Collections;
using Sitecore;
using Sitecore.Globalization;
using Sitecore.Resources;
using System.Web.UI;
using Sitecore.Text;
using Sitecore.Data;

namespace BaseFields
{
    public abstract class MultilistExBase : Sitecore.Shell.Applications.ContentEditor.MultilistEx
    {
        /// &amp;lt;summary&amp;gt;
        /// Return here your unselected items. First value is the ID you will store into your field, the second one is the display text.
        /// &amp;lt;/summary&amp;gt;
        /// &amp;lt;returns&amp;gt;The unselected items&amp;lt;/returns&amp;gt;
        protected abstract IEnumerable&amp;lt;KeyValuePair&amp;lt;string, string&amp;gt;&amp;gt; GetNonSelectedItems();
        /// &amp;lt;summary&amp;gt;
        /// Return here your selected items. First value is the ID you will store into your field, the second one is the display text.
        /// &amp;lt;/summary&amp;gt;
        /// &amp;lt;returns&amp;gt;The selected items&amp;lt;/returns&amp;gt;
        protected abstract IEnumerable&amp;lt;KeyValuePair&amp;lt;string, string&amp;gt;&amp;gt; GetSelectedItems();

        /// &amp;lt;summary&amp;gt;
        /// By overideing this method, you can initialise some variables here.
        /// &amp;lt;/summary&amp;gt;
        protected virtual void InitRendering()
        {
        }

        protected override void DoRender(System.Web.UI.HtmlTextWriter output)
        {
            Assert.ArgumentNotNull(output, &amp;quot;output&amp;quot;);

            base.ServerProperties[&amp;quot;ID&amp;quot;] = this.ID;

            InitRendering();

            string text = string.Empty;
            if (this.ReadOnly)
            {
                text = &amp;quot; disabled=\&amp;quot;disabled\&amp;quot;&amp;quot;;
            }
            output.Write(string.Concat(new string[]
                   {
                    &amp;quot;&amp;lt;input id=\&amp;quot;&amp;quot;, 
                    this.ID, 
                    &amp;quot;_Value\&amp;quot; type=\&amp;quot;hidden\&amp;quot; value=\&amp;quot;&amp;quot;, 
                    StringUtil.EscapeQuote(this.Value), 
                    &amp;quot;\&amp;quot; /&amp;gt;&amp;quot;
                   }));
            output.Write(&amp;quot;&amp;lt;table&amp;quot; + this.GetControlAttributes() + &amp;quot;&amp;gt;&amp;quot;);
            output.Write(&amp;quot;&amp;lt;tr&amp;gt;&amp;quot;);
            output.Write(&amp;quot;&amp;lt;td class=\&amp;quot;scContentControlMultilistCaption\&amp;quot; width=\&amp;quot;50%\&amp;quot;&amp;gt;&amp;quot; + Translate.Text(&amp;quot;All&amp;quot;) + &amp;quot;&amp;lt;/td&amp;gt;&amp;quot;);
            output.Write(&amp;quot;&amp;lt;td width=\&amp;quot;20\&amp;quot;&amp;gt;&amp;quot; + Images.GetSpacer(20, 1) + &amp;quot;&amp;lt;/td&amp;gt;&amp;quot;);
            output.Write(&amp;quot;&amp;lt;td class=\&amp;quot;scContentControlMultilistCaption\&amp;quot; width=\&amp;quot;50%\&amp;quot;&amp;gt;&amp;quot; + Translate.Text(&amp;quot;Selected&amp;quot;) + &amp;quot;&amp;lt;/td&amp;gt;&amp;quot;);
            output.Write(&amp;quot;&amp;lt;td width=\&amp;quot;20\&amp;quot;&amp;gt;&amp;quot; + Images.GetSpacer(20, 1) + &amp;quot;&amp;lt;/td&amp;gt;&amp;quot;);
            output.Write(&amp;quot;&amp;lt;/tr&amp;gt;&amp;quot;);
            output.Write(&amp;quot;&amp;lt;tr&amp;gt;&amp;quot;);
            output.Write(&amp;quot;&amp;lt;td valign=\&amp;quot;top\&amp;quot; height=\&amp;quot;100%\&amp;quot;&amp;gt;&amp;quot;);
            output.Write(string.Concat(new string[]
                   {
                    &amp;quot;&amp;lt;select id=\&amp;quot;&amp;quot;, 
                    this.ID, 
                    &amp;quot;_unselected\&amp;quot; class=\&amp;quot;scContentControlMultilistBox\&amp;quot; multiple=\&amp;quot;multiple\&amp;quot; size=\&amp;quot;10\&amp;quot;&amp;quot;, 
                    text, 
                    &amp;quot; ondblclick=\&amp;quot;javascript:scContent.multilistMoveRight('&amp;quot;, 
                    this.ID, 
                    &amp;quot;')\&amp;quot; onchange=\&amp;quot;javascript:document.getElementById('&amp;quot;, 
                    this.ID, 
                    &amp;quot;_all_help').innerHTML=this.selectedIndex&amp;gt;=0?this.options[this.selectedIndex].innerHTML:''\&amp;quot; &amp;gt;&amp;quot;
                   }));

            //Bind the selected values?
            foreach (KeyValuePair&amp;lt;string, string&amp;gt; field in GetNonSelectedItems())
            {
                //Item item2 = dictionaryEntry.Value as Item;
                //if (item2 != null)
                //{
                output.Write(string.Concat(new string[]
    {
     &amp;quot;&amp;lt;option value=\&amp;quot;&amp;quot;, 
     field.Key, 
     &amp;quot;\&amp;quot;&amp;gt;&amp;quot;, 
     field.Value, 
     &amp;quot;&amp;lt;/option&amp;gt;&amp;quot;
    }));
                //}
            }

            output.Write(&amp;quot;&amp;lt;/select&amp;gt;&amp;quot;);
            output.Write(&amp;quot;&amp;lt;/td&amp;gt;&amp;quot;);
            output.Write(&amp;quot;&amp;lt;td valign=\&amp;quot;top\&amp;quot;&amp;gt;&amp;quot;);
            this.RenderButton(output, &amp;quot;Core/16x16/arrow_blue_right.png&amp;quot;, &amp;quot;javascript:scContent.multilistMoveRight('&amp;quot; + this.ID + &amp;quot;')&amp;quot;);
            output.Write(&amp;quot;&amp;lt;br /&amp;gt;&amp;quot;);
            this.RenderButton(output, &amp;quot;Core/16x16/arrow_blue_left.png&amp;quot;, &amp;quot;javascript:scContent.multilistMoveLeft('&amp;quot; + this.ID + &amp;quot;')&amp;quot;);
            output.Write(&amp;quot;&amp;lt;/td&amp;gt;&amp;quot;);
            output.Write(&amp;quot;&amp;lt;td valign=\&amp;quot;top\&amp;quot; height=\&amp;quot;100%\&amp;quot;&amp;gt;&amp;quot;);
            output.Write(string.Concat(new string[]
               {
                &amp;quot;&amp;lt;select id=\&amp;quot;&amp;quot;, 
                this.ID, 
                &amp;quot;_selected\&amp;quot; class=\&amp;quot;scContentControlMultilistBox\&amp;quot; multiple=\&amp;quot;multiple\&amp;quot; size=\&amp;quot;10\&amp;quot;&amp;quot;, 
                text, 
                &amp;quot; ondblclick=\&amp;quot;javascript:scContent.multilistMoveLeft('&amp;quot;, 
                this.ID, 
                &amp;quot;')\&amp;quot; onchange=\&amp;quot;javascript:document.getElementById('&amp;quot;, 
                this.ID, 
                &amp;quot;_selected_help').innerHTML=this.selectedIndex&amp;gt;=0?this.options[this.selectedIndex].innerHTML:''\&amp;quot;&amp;gt;&amp;quot;
               }));

            //Bind the available items list
            foreach (KeyValuePair&amp;lt;string, string&amp;gt; field in GetSelectedItems())
            {
                output.Write(string.Concat(new string[]
    {
                    &amp;quot;&amp;lt;option value=\&amp;quot;&amp;quot;, 
     field.Key, 
     &amp;quot;\&amp;quot;&amp;gt;&amp;quot;, 
     field.Value, 
     &amp;quot;&amp;lt;/option&amp;gt;&amp;quot;
    }));

            }
            output.Write(&amp;quot;&amp;lt;/select&amp;gt;&amp;quot;);
            output.Write(&amp;quot;&amp;lt;/td&amp;gt;&amp;quot;);
            output.Write(&amp;quot;&amp;lt;td valign=\&amp;quot;top\&amp;quot;&amp;gt;&amp;quot;);
            this.RenderButton(output, &amp;quot;Core/16x16/arrow_blue_up.png&amp;quot;, &amp;quot;javascript:scContent.multilistMoveUp('&amp;quot; + this.ID + &amp;quot;')&amp;quot;);
            output.Write(&amp;quot;&amp;lt;br /&amp;gt;&amp;quot;);
            this.RenderButton(output, &amp;quot;Core/16x16/arrow_blue_down.png&amp;quot;, &amp;quot;javascript:scContent.multilistMoveDown('&amp;quot; + this.ID + &amp;quot;')&amp;quot;);
            output.Write(&amp;quot;&amp;lt;/td&amp;gt;&amp;quot;);
            output.Write(&amp;quot;&amp;lt;/tr&amp;gt;&amp;quot;);
            output.Write(&amp;quot;&amp;lt;tr&amp;gt;&amp;quot;);
            output.Write(&amp;quot;&amp;lt;td valign=\&amp;quot;top\&amp;quot;&amp;gt;&amp;quot;);
            output.Write(&amp;quot;&amp;lt;div style=\&amp;quot;border:1px solid #999999;font:8pt tahoma;padding:2px;margin:4px 0px 4px 0px;height:14px\&amp;quot; id=\&amp;quot;&amp;quot; + this.ID + &amp;quot;_all_help\&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&amp;quot;);
            output.Write(&amp;quot;&amp;lt;/td&amp;gt;&amp;quot;);
            output.Write(&amp;quot;&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&amp;quot;);
            output.Write(&amp;quot;&amp;lt;td valign=\&amp;quot;top\&amp;quot;&amp;gt;&amp;quot;);
            output.Write(&amp;quot;&amp;lt;div style=\&amp;quot;border:1px solid #999999;font:8pt tahoma;padding:2px;margin:4px 0px 4px 0px;height:14px\&amp;quot; id=\&amp;quot;&amp;quot; + this.ID + &amp;quot;_selected_help\&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&amp;quot;);
            output.Write(&amp;quot;&amp;lt;/td&amp;gt;&amp;quot;);
            output.Write(&amp;quot;&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&amp;quot;);
            output.Write(&amp;quot;&amp;lt;/tr&amp;gt;&amp;quot;);
            output.Write(&amp;quot;&amp;lt;/table&amp;gt;&amp;quot;);
            
        }        

        private void RenderButton(HtmlTextWriter output, string icon, string click)
        {
            Assert.ArgumentNotNull(output, &amp;quot;output&amp;quot;);
            Assert.ArgumentNotNull(icon, &amp;quot;icon&amp;quot;);
            Assert.ArgumentNotNull(click, &amp;quot;click&amp;quot;);
            ImageBuilder imageBuilder = new ImageBuilder();
            imageBuilder.Src = icon;
            imageBuilder.Width = 16;
            imageBuilder.Height = 16;
            imageBuilder.Margin = &amp;quot;2px&amp;quot;;
            if (!this.ReadOnly)
            {
                imageBuilder.OnClick = click;
            }
            output.Write(imageBuilder.ToString());
        }
    }
}quot;_selected_help').innerHTML=this.selectedIndex&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/SitecoreBlog/~4/jz7u5bSK7yM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sitecoreblog.blogspot.com/feeds/4205685071051249202/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://sitecoreblog.blogspot.com/2012/04/how-to-create-custom-multilist-field.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/630324887720106786/posts/default/4205685071051249202?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/630324887720106786/posts/default/4205685071051249202?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SitecoreBlog/~3/jz7u5bSK7yM/how-to-create-custom-multilist-field.html" title="How to create a custom Multilist field not related to the items" /><author><name>Vangansewinkel Benjamin</name><uri>http://www.blogger.com/profile/01696678283653731912</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="23" height="32" src="http://3.bp.blogspot.com/_Nd7hE7ZxH34/TQYjYUJJL4I/AAAAAAAAABE/TTsBcYDuEoc/S220/ben2.png" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-hedBgmeDOH8/T4vPYiFjgzI/AAAAAAAAAGE/UKARPf70j3Y/s72-c/2012-04-16_0859.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://sitecoreblog.blogspot.com/2012/04/how-to-create-custom-multilist-field.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A08AQXo7cCp7ImA9WhVSF00.&quot;"><id>tag:blogger.com,1999:blog-630324887720106786.post-4939878070879646507</id><published>2012-03-14T08:24:00.000+01:00</published><updated>2012-03-14T08:24:00.408+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-03-14T08:24:00.408+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Configuration" /><title>Add a custom section in the config</title><content type="html">Here is the method if you need to a custom section into you config file.&lt;br /&gt;
&lt;br /&gt;Here is my example of config that I need to include into my \App_Config\Include folder:&lt;br /&gt;
&lt;pre class="xml" name="code"&gt;&amp;lt;configuration xmlns:patch=&amp;quot;http://www.sitecore.net/xmlconfig/&amp;quot;&amp;gt;
  &amp;lt;sitecore&amp;gt;
 &amp;lt;MyCustomSection&amp;gt;
  &amp;lt;MyCustomElement Name=&amp;quot;XXX&amp;quot; MyProperty=&amp;quot;YYY&amp;quot; /&amp;gt;
  &amp;lt;MyCustomElement Name=&amp;quot;AAA&amp;quot; MyProperty=&amp;quot;BBB&amp;quot; /&amp;gt;
 &amp;lt;/MyCustomSection&amp;gt;
  &amp;lt;/sitecore&amp;gt;
&amp;lt;/configuration&amp;gt;&lt;/pre&gt;
&lt;br /&gt;And here is a way to read it:&lt;br /&gt;
&lt;pre class="csharp" name="code"&gt;using System.Collections.Generic;
using Sitecore.Configuration;
using System.Xml;
using Sitecore.Xml;

/// &amp;lt;summary&amp;gt;
/// TODO: Update summary.
/// &amp;lt;/summary&amp;gt;
public class MyConfigElement
{
 //The two properties corresponding to the properties into the config
 public string Name { get; set; }
 public string MyProperty { get; set; }

 //The method who return the list of my custom elements
 public static List&amp;lt;MyConfigElement&amp;gt; GetListMyCustomElements()
 {
  List&amp;lt;MyConfigElement&amp;gt; lst = new List&amp;lt;MyConfigElement&amp;gt;();
  
  //Read the configuration nodes
  foreach (XmlNode node in Factory.GetConfigNodes(&amp;quot;MyCustomSection/MyCustomElement&amp;quot;))
  {
   //Create a element of this type
   MyConfigElement elem = new MyConfigElement();
   elem.Name = XmlUtil.GetAttribute(&amp;quot;Name&amp;quot;, node);
   elem.MyProperty = XmlUtil.GetAttribute(&amp;quot;MyProperty&amp;quot;, node);
   lst.Add(elem);
  }
  return lst;
 }
}&lt;/pre&gt;
&lt;br /&gt;Don’t forget to use a property “Name” to avoid the conflicts in the include folder (see this post: &lt;a href="http://sitecoreblog.blogspot.com/2012/02/config-patching-system-for-external.html"&gt;http://sitecoreblog.blogspot.com/2012/02/config-patching-system-for-external.html&lt;/a&gt;)&lt;img src="http://feeds.feedburner.com/~r/SitecoreBlog/~4/8YkPas5Eb-Q" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sitecoreblog.blogspot.com/feeds/4939878070879646507/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://sitecoreblog.blogspot.com/2012/03/add-custom-section-in-config.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/630324887720106786/posts/default/4939878070879646507?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/630324887720106786/posts/default/4939878070879646507?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SitecoreBlog/~3/8YkPas5Eb-Q/add-custom-section-in-config.html" title="Add a custom section in the config" /><author><name>Vangansewinkel Benjamin</name><uri>http://www.blogger.com/profile/01696678283653731912</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="23" height="32" src="http://3.bp.blogspot.com/_Nd7hE7ZxH34/TQYjYUJJL4I/AAAAAAAAABE/TTsBcYDuEoc/S220/ben2.png" /></author><thr:total>0</thr:total><feedburner:origLink>http://sitecoreblog.blogspot.com/2012/03/add-custom-section-in-config.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEUFRno7cSp7ImA9WhVTFkU.&quot;"><id>tag:blogger.com,1999:blog-630324887720106786.post-7377540783496081054</id><published>2012-03-02T12:03:00.001+01:00</published><updated>2012-03-02T12:03:37.409+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-03-02T12:03:37.409+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Configuration" /><title>Include the sc namespace</title><content type="html">When you have multiple projects in a single solution you will maybe have this error message when you try to use some sitecore controls like the sc:Text:
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-xCqajA142qo/T1CmnbWcJdI/AAAAAAAAAFk/SfE22wvx6U0/s1600/2012-03-02_1143.png" imageanchor="1"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-xCqajA142qo/T1CmnbWcJdI/AAAAAAAAAFk/SfE22wvx6U0/s1600/2012-03-02_1143.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;br /&gt;&lt;/div&gt;
You have to simple solutions to fix this problem:
&lt;br /&gt;
&lt;br /&gt;
You may add this line on the top of each files:
&lt;br /&gt;
&lt;pre class="xml" name="code"&gt;&amp;lt;%@ Register Assembly="Sitecore.Kernel" Namespace="Sitecore.Web.UI.WebControls" TagPrefix="sc" %&amp;gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
Or you may add a web.config into your project with the minimal information to include this namespace. &lt;br /&gt;
But don’t deploy this web.config in your solution because it will override the correct sitecore web.config&lt;br /&gt;
&lt;pre class="xml" name="code"&gt;&amp;lt;?xml version="1.0"?&amp;gt;
&amp;lt;configuration&amp;gt;
  &amp;lt;system.web&amp;gt;
    &amp;lt;pages validateRequest="false"&amp;gt;
      &amp;lt;controls&amp;gt;
        &amp;lt;add tagPrefix="sc" namespace="Sitecore.Web.UI.WebControls" assembly="Sitecore.Kernel" /&amp;gt;
        &amp;lt;add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&amp;gt;
        &amp;lt;add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&amp;gt;
        &amp;lt;add tagPrefix="sc" namespace="Sitecore.Web.UI.WebControls" assembly="Sitecore.Analytics" /&amp;gt;
      &amp;lt;/controls&amp;gt;
    &amp;lt;/pages&amp;gt;
  &amp;lt;/system.web&amp;gt;
&amp;lt;/configuration&amp;gt;&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/SitecoreBlog/~4/zzTMkziLQLg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sitecoreblog.blogspot.com/feeds/7377540783496081054/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://sitecoreblog.blogspot.com/2012/03/include-sc-namespace.html#comment-form" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/630324887720106786/posts/default/7377540783496081054?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/630324887720106786/posts/default/7377540783496081054?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SitecoreBlog/~3/zzTMkziLQLg/include-sc-namespace.html" title="Include the sc namespace" /><author><name>Vangansewinkel Benjamin</name><uri>http://www.blogger.com/profile/01696678283653731912</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="23" height="32" src="http://3.bp.blogspot.com/_Nd7hE7ZxH34/TQYjYUJJL4I/AAAAAAAAABE/TTsBcYDuEoc/S220/ben2.png" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-xCqajA142qo/T1CmnbWcJdI/AAAAAAAAAFk/SfE22wvx6U0/s72-c/2012-03-02_1143.png" height="72" width="72" /><thr:total>3</thr:total><feedburner:origLink>http://sitecoreblog.blogspot.com/2012/03/include-sc-namespace.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CU4CRX8-cSp7ImA9WhRaFEs.&quot;"><id>tag:blogger.com,1999:blog-630324887720106786.post-4910552471619604879</id><published>2012-02-17T08:32:00.000+01:00</published><updated>2012-02-17T08:32:44.159+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-02-17T08:32:44.159+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="TDS" /><title>Team development for sitecore (TDS) - Double build required</title><content type="html">With Team development for sitecore (TDS) some developers of my company complain that they need to build the solution twice to have they change in the deploy folder.&lt;br /&gt;
&lt;br /&gt;
After some investigations, I have found that sometime TDS doesn't create the dependencies correctly. And, with those dependencies not correctly set the TDS project is build &lt;b&gt;before&lt;/b&gt; the project to deploy. &lt;br /&gt;
&lt;br /&gt;
The bug fix is pretty easy:&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;&lt;div&gt;Right click on your solution and then on "&lt;i&gt;properties&lt;/i&gt;"&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;Click on the "&lt;i&gt;Project Dependencies&lt;/i&gt;"&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-885Erte0pIc/Tz4BHwGRKvI/AAAAAAAAAE8/4KvDALtmaB4/s1600/2012-02-17_0817.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="385" src="http://2.bp.blogspot.com/-885Erte0pIc/Tz4BHwGRKvI/AAAAAAAAAE8/4KvDALtmaB4/s400/2012-02-17_0817.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;In the "&lt;i&gt;project&lt;/i&gt;" dropdown select your project to deploy and uncheck the corresponding TDS project&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-5Cnc63K6Fls/Tz4BN7Ku8iI/AAAAAAAAAFE/ZHW8fkQziI8/s1600/2012-02-17_0820.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="466" src="http://4.bp.blogspot.com/-5Cnc63K6Fls/Tz4BN7Ku8iI/AAAAAAAAAFE/ZHW8fkQziI8/s640/2012-02-17_0820.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt; In the "&lt;i&gt;project&lt;/i&gt;" dropdown select your TDS project to deploy and check the corresponding project to deploy&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-dA_IHDwyIBo/Tz4BdclMITI/AAAAAAAAAFU/sD5E7NHiJt0/s1600/2012-02-17_0820_001.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="465" src="http://4.bp.blogspot.com/-dA_IHDwyIBo/Tz4BdclMITI/AAAAAAAAAFU/sD5E7NHiJt0/s640/2012-02-17_0820_001.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;img src="http://feeds.feedburner.com/~r/SitecoreBlog/~4/lhK0CBdVCII" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sitecoreblog.blogspot.com/feeds/4910552471619604879/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://sitecoreblog.blogspot.com/2012/02/team-development-for-sitecore-tds.html#comment-form" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/630324887720106786/posts/default/4910552471619604879?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/630324887720106786/posts/default/4910552471619604879?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SitecoreBlog/~3/lhK0CBdVCII/team-development-for-sitecore-tds.html" title="Team development for sitecore (TDS) - Double build required" /><author><name>Vangansewinkel Benjamin</name><uri>http://www.blogger.com/profile/01696678283653731912</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="23" height="32" src="http://3.bp.blogspot.com/_Nd7hE7ZxH34/TQYjYUJJL4I/AAAAAAAAABE/TTsBcYDuEoc/S220/ben2.png" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-885Erte0pIc/Tz4BHwGRKvI/AAAAAAAAAE8/4KvDALtmaB4/s72-c/2012-02-17_0817.png" height="72" width="72" /><thr:total>3</thr:total><feedburner:origLink>http://sitecoreblog.blogspot.com/2012/02/team-development-for-sitecore-tds.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEcDQ3c_eyp7ImA9WhRaEkQ.&quot;"><id>tag:blogger.com,1999:blog-630324887720106786.post-597996645617790338</id><published>2012-02-15T08:47:00.000+01:00</published><updated>2012-02-15T08:47:52.943+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-02-15T08:47:52.943+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Configuration" /><title>Config patching system for the external config files</title><content type="html">This very good post &lt;a href="http://www.thescrewballdivision.com/playing-with-sitecore-include-files"&gt;http://www.thescrewballdivision.com/playing-with-sitecore-include-files&lt;/a&gt; explain the available commands for the patching very well so I will not copy it but I will add an important information.&lt;br /&gt;
&lt;br /&gt;
When you need to add some informations in a tag the key used for the merge is the property name.&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;Example&lt;/u&gt;:&lt;br /&gt;
&lt;br /&gt;
By default in the web.config you have this:&lt;br /&gt;
&lt;pre class="xml" name="code"&gt;&amp;lt;event name=&amp;quot;publish:end&amp;quot;&amp;gt;
 &amp;lt;handler type=&amp;quot;Sitecore.Publishing.HtmlCacheClearer, Sitecore.Kernel&amp;quot; method=&amp;quot;ClearCache&amp;quot;&amp;gt;
   &amp;lt;sites hint=&amp;quot;list&amp;quot;&amp;gt;    
      &amp;lt;site&amp;gt;website&amp;lt;/site&amp;gt;
   &amp;lt;/sites&amp;gt;
 &amp;lt;/handler&amp;gt;
&amp;lt;/event&amp;gt; 
&lt;/pre&gt;&lt;br /&gt;
And if you add this in a separated config file:&lt;br /&gt;
&lt;pre class="xml" name="code"&gt;&amp;lt;event name=&amp;quot;publish:end&amp;quot;&amp;gt;
 &amp;lt;handler type=&amp;quot;Sitecore.Publishing.HtmlCacheClearer, Sitecore.Kernel&amp;quot; method=&amp;quot;ClearCache&amp;quot;&amp;gt;
   &amp;lt;sites hint=&amp;quot;list&amp;quot;&amp;gt;    
     &amp;lt;site&amp;gt;mysite&amp;lt;/site&amp;gt;
   &amp;lt;/sites&amp;gt;
 &amp;lt;/handler&amp;gt;
&amp;lt;/event&amp;gt; 
&lt;/pre&gt;&lt;br /&gt;
The merged web.config will be:&lt;br /&gt;
&lt;pre class="xml" name="code"&gt;&amp;lt;event name=&amp;quot;publish:end&amp;quot;&amp;gt;
 &amp;lt;handler type=&amp;quot;Sitecore.Publishing.HtmlCacheClearer, Sitecore.Kernel&amp;quot; method=&amp;quot;ClearCache&amp;quot;&amp;gt;
   &amp;lt;sites hint=&amp;quot;list&amp;quot;&amp;gt;    
      &amp;lt;site&amp;gt;mysite&amp;lt;/site&amp;gt;
   &amp;lt;/sites&amp;gt;
 &amp;lt;/handler&amp;gt;
&amp;lt;/event&amp;gt; 
&lt;/pre&gt;&lt;br /&gt;
To avoid this and combine the two tags without removing the existing one you only have to add a name property in the site tag:&lt;br /&gt;
&lt;pre class="xml" name="code"&gt;&amp;lt;event name=&amp;quot;publish:end&amp;quot;&amp;gt;
 &amp;lt;handler type=&amp;quot;Sitecore.Publishing.HtmlCacheClearer, Sitecore.Kernel&amp;quot; method=&amp;quot;ClearCache&amp;quot;&amp;gt;
   &amp;lt;sites hint=&amp;quot;list&amp;quot;&amp;gt;    
      &amp;lt;site name=&amp;quot;mysite&amp;quot;&amp;gt;mysite&amp;lt;/site&amp;gt;
   &amp;lt;/sites&amp;gt;
 &amp;lt;/handler&amp;gt;
&amp;lt;/event&amp;gt; &lt;/pre&gt;&lt;br /&gt;
Like this you will have the expected result:&lt;br /&gt;
&lt;pre class="xml" name="code"&gt;&amp;lt;event name=&amp;quot;publish:end&amp;quot;&amp;gt;
 &amp;lt;handler type=&amp;quot;Sitecore.Publishing.HtmlCacheClearer, Sitecore.Kernel&amp;quot; method=&amp;quot;ClearCache&amp;quot;&amp;gt;
   &amp;lt;sites hint=&amp;quot;list&amp;quot;&amp;gt;  
      &amp;lt;site&amp;gt;website&amp;lt;/site&amp;gt;
      &amp;lt;site name=&amp;quot;mysite&amp;quot;&amp;gt;mysite&amp;lt;/site&amp;gt;
   &amp;lt;/sites&amp;gt;
 &amp;lt;/handler&amp;gt;
&amp;lt;/event&amp;gt; &lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/SitecoreBlog/~4/4ukr6bkhE9o" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sitecoreblog.blogspot.com/feeds/597996645617790338/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://sitecoreblog.blogspot.com/2012/02/config-patching-system-for-external.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/630324887720106786/posts/default/597996645617790338?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/630324887720106786/posts/default/597996645617790338?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SitecoreBlog/~3/4ukr6bkhE9o/config-patching-system-for-external.html" title="Config patching system for the external config files" /><author><name>Vangansewinkel Benjamin</name><uri>http://www.blogger.com/profile/01696678283653731912</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="23" height="32" src="http://3.bp.blogspot.com/_Nd7hE7ZxH34/TQYjYUJJL4I/AAAAAAAAABE/TTsBcYDuEoc/S220/ben2.png" /></author><thr:total>0</thr:total><feedburner:origLink>http://sitecoreblog.blogspot.com/2012/02/config-patching-system-for-external.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEIMRH8-cSp7ImA9WhRbF0o.&quot;"><id>tag:blogger.com,1999:blog-630324887720106786.post-3938247374034955009</id><published>2012-02-09T08:29:00.000+01:00</published><updated>2012-02-09T08:29:45.159+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-02-09T08:29:45.159+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Error messages" /><title>Error message - The operation could not be completed</title><content type="html">I post here an error message I had yesterday on the sitecore of one of our customer because I don't have found this answer on the sdn site of in the forums.&lt;br /&gt;
&lt;br /&gt;
We had randomly some error messages: &lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-X_4vVycODI0/TzNyL1Zb6yI/AAAAAAAAAEQ/RBDe_QsUGyM/s1600/2012-02-09_0807.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="189" src="http://4.bp.blogspot.com/-X_4vVycODI0/TzNyL1Zb6yI/AAAAAAAAAEQ/RBDe_QsUGyM/s320/2012-02-09_0807.png" width="277" /&gt;&lt;/a&gt;&lt;/div&gt;"The operation could not be completed.&lt;br /&gt;
&lt;br /&gt;
Your session may have been lost due to a time-out or a server failure.&lt;br /&gt;
&lt;br /&gt;
Try again."&lt;br /&gt;
&lt;div class="clear"&gt;&lt;/div&gt;After investigation, I don't have found any error messages in the logs or in the windows event viewer. But, we had multiple log files with the same datetime.&lt;br /&gt;
&lt;br /&gt;
In fact the resolution was pretty simple the number of worker process of the application pool was set to 5 but it must be set to 1.&lt;br /&gt;
&lt;br /&gt;
To change it:&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;In iis select your application pool and click on the "Advanced settings" button&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-Ic6bCBzzaDw/TzN0XgqmzXI/AAAAAAAAAEc/o3CN5TYu8hw/s1600/2012-02-09_0818.png" imageanchor="1"&gt;&lt;img border="0" height="331" src="http://2.bp.blogspot.com/-Ic6bCBzzaDw/TzN0XgqmzXI/AAAAAAAAAEc/o3CN5TYu8hw/s640/2012-02-09_0818.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;In the "Process Model" section, set the "Maximum Worker Process" to 1.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-JUdIhlAygJw/TzN0i3mP_RI/AAAAAAAAAEs/Oj-zIxehxPs/s1600/2012-02-09_0820.png" imageanchor="1"&gt;&lt;img border="0" height="320" src="http://4.bp.blogspot.com/-JUdIhlAygJw/TzN0i3mP_RI/AAAAAAAAAEs/Oj-zIxehxPs/s320/2012-02-09_0820.png" width="262" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;img src="http://feeds.feedburner.com/~r/SitecoreBlog/~4/rXHx46lRTcc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sitecoreblog.blogspot.com/feeds/3938247374034955009/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://sitecoreblog.blogspot.com/2012/02/error-message-operation-could-not-be.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/630324887720106786/posts/default/3938247374034955009?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/630324887720106786/posts/default/3938247374034955009?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SitecoreBlog/~3/rXHx46lRTcc/error-message-operation-could-not-be.html" title="Error message - The operation could not be completed" /><author><name>Vangansewinkel Benjamin</name><uri>http://www.blogger.com/profile/01696678283653731912</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="23" height="32" src="http://3.bp.blogspot.com/_Nd7hE7ZxH34/TQYjYUJJL4I/AAAAAAAAABE/TTsBcYDuEoc/S220/ben2.png" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-X_4vVycODI0/TzNyL1Zb6yI/AAAAAAAAAEQ/RBDe_QsUGyM/s72-c/2012-02-09_0807.png" height="72" width="72" /><thr:total>2</thr:total><feedburner:origLink>http://sitecoreblog.blogspot.com/2012/02/error-message-operation-could-not-be.html</feedburner:origLink></entry></feed>
