<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/rss2full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>Alexey Rusakov on Sitecore development</title>
    <link>http://alexeyrusakov.com/sitecoreblog/</link>
    <description>Sitecore CMS and everything related</description>
    <language>en-us</language>
    <copyright>Alexey Rusakov</copyright>
    <lastBuildDate>Thu, 09 Oct 2008 20:57:00 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.0.7226.0</generator>
    <managingEditor>ar@sitecore.net</managingEditor>
    <webMaster>ar@sitecore.net</webMaster>
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/alexeyrusakov/sitecore" type="application/rss+xml" /><item>
      <trackback:ping>http://alexeyrusakov.com/sitecoreblog/Trackback.aspx?guid=21e62bae-7479-4099-89e3-109a97c11c62</trackback:ping>
      <pingback:server>http://alexeyrusakov.com/sitecoreblog/pingback.aspx</pingback:server>
      <pingback:target>http://alexeyrusakov.com/sitecoreblog/PermaLink,guid,21e62bae-7479-4099-89e3-109a97c11c62.aspx</pingback:target>
      <dc:creator>Alexey Rusakov</dc:creator>
      <wfw:comment>http://alexeyrusakov.com/sitecoreblog/CommentView,guid,21e62bae-7479-4099-89e3-109a97c11c62.aspx</wfw:comment>
      <wfw:commentRss>http://alexeyrusakov.com/sitecoreblog/SyndicationService.asmx/GetEntryCommentsRss?guid=21e62bae-7479-4099-89e3-109a97c11c62</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Today I’ll go with the example suggested by Lars. Suppose we’re implementing a new <em>money</em> field
type to store both the numeric amount and the currency (229 US Dollars). Both bits
of information are stored in a single field using XML, which is a typical approach
for Sitecore.
</p>
        <p>
I’ll skip the whole <a href="http://sdn5.sitecore.net/Articles/API/Creating%20a%20Composite%20Custom%20Field.aspx">implementing
a new field type</a> part (no need to repeat SDN); lets say that the Sitecore Client
part is already implemented, and editors are able to use the Content Editor to change
field value.
</p>
        <p>
One problem remains – how to output <em>money</em> values on the website? The field
contains XML, so we can’t just do <em>sc:fld(‘money’, .)</em>. Different currencies
have different signs which can go before or after the amount, which makes non-trivial
rendering logic. The typical Sitecore 5 solution would be to implement a new XSL extension
method and/or .NET web control. 
</p>
        <p>
In Sitecore 6, however, you can use the renderField pipeline to make existing rendering
methods properly render custom field types.
</p>
        <p>
Once again, this is a clean <em>renderField</em> pipeline:
</p>
        <p>
&lt;renderField&gt;<br />
  &lt;processor type="Sitecore.Pipelines.RenderField.GetFieldValue, Sitecore.Kernel"/&gt;<br />
  &lt;processor type="Sitecore.Pipelines.RenderField.ExpandLinks, Sitecore.Kernel"/&gt;<br />
  &lt;processor type="Sitecore.Pipelines.RenderField.GetImageFieldValue, Sitecore.Kernel"/&gt;<br />
  &lt;processor type="Sitecore.Pipelines.RenderField.GetLinkFieldValue, Sitecore.Kernel"/&gt;<br />
  &lt;processor type="Sitecore.Pipelines.RenderField.GetInternalLinkFieldValue,
Sitecore.Kernel"/&gt;<br />
  &lt;processor type="Sitecore.Pipelines.RenderField.GetMemoFieldValue, Sitecore.Kernel"/&gt;<br />
  &lt;processor type="Sitecore.Pipelines.RenderField.GetDateFieldValue, Sitecore.Kernel"/&gt;<br />
  &lt;processor type="Sitecore.Pipelines.RenderField.AddBeforeAndAfterValues,
Sitecore.Kernel"/&gt;<br />
  &lt;processor type="Sitecore.Pipelines.RenderField.RenderWebEditing, Sitecore.Kernel"/&gt;<br />
&lt;/renderField&gt; 
</p>
        <p>
Most processors are responsible for rendering specific field types, plus there are
some additional processors supporting Sitecore architecture.
</p>
        <p>
Following the naming convention, we’ll create a new GetMoneyFieldValue processor and
place it after all Get* processors, but before the AddBeforeAndAfterValues:
</p>
        <p>
        </p>
  &lt;processor type="Sitecore.Pipelines.RenderField.GetDateFieldValue, Sitecore.Kernel"/&gt;<br />
  <strong>&lt;processor type="Money.GetMoneyFieldValue, Money" /&gt;</strong><br />
  &lt;processor type="Sitecore.Pipelines.RenderField.AddBeforeAndAfterValues,
Sitecore.Kernel"/&gt; 
<p /><p>
The processor responsibility is to render HTML. I’m assuming that money field contains
the following XML: &lt;money currency=”USD” amount=”229.99” /&gt;
</p><pre>public class GetMoneyFieldValue {
  public void Process(RenderFieldArgs args) {
    if (args.FieldTypeKey != "money") {
      return;
    }

    var doc = new XmlDocument();
    doc.LoadXml(args.FieldValue);

    string currency = doc.DocumentElement.GetAttribute("currency");
    string amount = doc.DocumentElement.GetAttribute("amount");

    string result = string.Empty;

    if (currency == "USD") {
      result = "$" + amount;
    }
    else if (currency == "DKK") {
      result = amount + " kr.";
    }

    args.Result.FirstPart = result;
  }
}
</pre><p>
First, and most importantly, the processor has to check the type of the field being
rendered. It’s only supposed to render <em>money</em> fields and ignore everything
else. Then we retrieve the field value – notice the FieldValue property. The value
is parsed, and depending on the currency we nicely render the monetary amount of either
American dollars or Danish kroner. The result is stored in args.Result.FirstPart - <em>money</em> field
is not supposed to be able to wrap other values, so nevermind the LastPart.
</p><h3>Why Bother?
</h3><p>
Implementing the above processor gives website developers the ability to use standard
Sitecore field rendering methods to properly render <em>money</em> fields. Developers
can do <em>sc:field(‘money’, .)</em> or use the <em>FieldRenderer</em> class and never
have a second thought.
</p><img width="0" height="0" src="http://alexeyrusakov.com/sitecoreblog/aggbug.ashx?id=21e62bae-7479-4099-89e3-109a97c11c62" /><xhtml:img xmlns:xhtml="http://www.w3.org/1999/xhtml" src="http://feeds.feedburner.com/~r/alexeyrusakov/sitecore/~4/415843147" height="1" width="1" /></body>
      <title>Using renderField to Support New Field Types</title>
      <guid isPermaLink="false">http://alexeyrusakov.com/sitecoreblog/PermaLink,guid,21e62bae-7479-4099-89e3-109a97c11c62.aspx</guid>
      <link>http://alexeyrusakov.com/sitecoreblog/2008/10/09/Using+RenderField+To+Support+New+Field+Types.aspx</link>
      <pubDate>Thu, 09 Oct 2008 20:57:00 GMT</pubDate>
      <description>&lt;p&gt;
Today I’ll go with the example suggested by Lars. Suppose we’re implementing a new &lt;em&gt;money&lt;/em&gt; field
type to store both the numeric amount and the currency (229 US Dollars). Both bits
of information are stored in a single field using XML, which is a typical approach
for Sitecore.
&lt;/p&gt;
&lt;p&gt;
I’ll skip the whole &lt;a href="http://sdn5.sitecore.net/Articles/API/Creating%20a%20Composite%20Custom%20Field.aspx"&gt;implementing
a new field type&lt;/a&gt; part (no need to repeat SDN); lets say that the Sitecore Client
part is already implemented, and editors are able to use the Content Editor to change
field value.
&lt;/p&gt;
&lt;p&gt;
One problem remains – how to output &lt;em&gt;money&lt;/em&gt; values on the website? The field
contains XML, so we can’t just do &lt;em&gt;sc:fld(‘money’, .)&lt;/em&gt;. Different currencies
have different signs which can go before or after the amount, which makes non-trivial
rendering logic. The typical Sitecore 5 solution would be to implement a new XSL extension
method and/or .NET web control. 
&lt;/p&gt;
&lt;p&gt;
In Sitecore 6, however, you can use the renderField pipeline to make existing rendering
methods properly render custom field types.
&lt;/p&gt;
&lt;p&gt;
Once again, this is a clean &lt;em&gt;renderField&lt;/em&gt; pipeline:
&lt;/p&gt;
&lt;p&gt;
&amp;lt;renderField&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;processor type="Sitecore.Pipelines.RenderField.GetFieldValue, Sitecore.Kernel"/&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;processor type="Sitecore.Pipelines.RenderField.ExpandLinks, Sitecore.Kernel"/&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;processor type="Sitecore.Pipelines.RenderField.GetImageFieldValue, Sitecore.Kernel"/&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;processor type="Sitecore.Pipelines.RenderField.GetLinkFieldValue, Sitecore.Kernel"/&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;processor type="Sitecore.Pipelines.RenderField.GetInternalLinkFieldValue,
Sitecore.Kernel"/&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;processor type="Sitecore.Pipelines.RenderField.GetMemoFieldValue, Sitecore.Kernel"/&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;processor type="Sitecore.Pipelines.RenderField.GetDateFieldValue, Sitecore.Kernel"/&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;processor type="Sitecore.Pipelines.RenderField.AddBeforeAndAfterValues,
Sitecore.Kernel"/&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;processor type="Sitecore.Pipelines.RenderField.RenderWebEditing, Sitecore.Kernel"/&amp;gt;&lt;br&gt;
&amp;lt;/renderField&amp;gt; 
&lt;p&gt;
Most processors are responsible for rendering specific field types, plus there are
some additional processors supporting Sitecore architecture.
&lt;/p&gt;
&lt;p&gt;
Following the naming convention, we’ll create a new GetMoneyFieldValue processor and
place it after all Get* processors, but before the AddBeforeAndAfterValues:
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&amp;nbsp; &amp;lt;processor type="Sitecore.Pipelines.RenderField.GetDateFieldValue, Sitecore.Kernel"/&amp;gt;&lt;br&gt;
&amp;nbsp; &lt;strong&gt;&amp;lt;processor type="Money.GetMoneyFieldValue, Money" /&amp;gt;&lt;/strong&gt;
&lt;br&gt;
&amp;nbsp; &amp;lt;processor type="Sitecore.Pipelines.RenderField.AddBeforeAndAfterValues,
Sitecore.Kernel"/&amp;gt; 
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
The processor responsibility is to render HTML. I’m assuming that money field contains
the following XML: &amp;lt;money currency=”USD” amount=”229.99” /&amp;gt;
&lt;/p&gt;
&lt;pre&gt;public class GetMoneyFieldValue {
  public void Process(RenderFieldArgs args) {
    if (args.FieldTypeKey != "money") {
      return;
    }

    var doc = new XmlDocument();
    doc.LoadXml(args.FieldValue);

    string currency = doc.DocumentElement.GetAttribute("currency");
    string amount = doc.DocumentElement.GetAttribute("amount");

    string result = string.Empty;

    if (currency == "USD") {
      result = "$" + amount;
    }
    else if (currency == "DKK") {
      result = amount + " kr.";
    }

    args.Result.FirstPart = result;
  }
}
&lt;/pre&gt;
&lt;p&gt;
First, and most importantly, the processor has to check the type of the field being
rendered. It’s only supposed to render &lt;em&gt;money&lt;/em&gt; fields and ignore everything
else. Then we retrieve the field value – notice the FieldValue property. The value
is parsed, and depending on the currency we nicely render the monetary amount of either
American dollars or Danish kroner. The result is stored in args.Result.FirstPart - &lt;em&gt;money&lt;/em&gt; field
is not supposed to be able to wrap other values, so nevermind the LastPart.
&lt;/p&gt;
&lt;h3&gt;Why Bother?
&lt;/h3&gt;
&lt;p&gt;
Implementing the above processor gives website developers the ability to use standard
Sitecore field rendering methods to properly render &lt;em&gt;money&lt;/em&gt; fields. Developers
can do &lt;em&gt;sc:field(‘money’, .)&lt;/em&gt; or use the &lt;em&gt;FieldRenderer&lt;/em&gt; class and never
have a second thought.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://alexeyrusakov.com/sitecoreblog/aggbug.ashx?id=21e62bae-7479-4099-89e3-109a97c11c62" /&gt;</description>
      <comments>http://alexeyrusakov.com/sitecoreblog/CommentView,guid,21e62bae-7479-4099-89e3-109a97c11c62.aspx</comments>
      <category>Sitecore</category>
      <category>Sitecore/Crestone</category>
    </item>
    <item>
      <trackback:ping>http://alexeyrusakov.com/sitecoreblog/Trackback.aspx?guid=ad80e255-0b77-4759-86c2-5ae5eef8da53</trackback:ping>
      <pingback:server>http://alexeyrusakov.com/sitecoreblog/pingback.aspx</pingback:server>
      <pingback:target>http://alexeyrusakov.com/sitecoreblog/PermaLink,guid,ad80e255-0b77-4759-86c2-5ae5eef8da53.aspx</pingback:target>
      <dc:creator>Alexey Rusakov</dc:creator>
      <wfw:comment>http://alexeyrusakov.com/sitecoreblog/CommentView,guid,ad80e255-0b77-4759-86c2-5ae5eef8da53.aspx</wfw:comment>
      <wfw:commentRss>http://alexeyrusakov.com/sitecoreblog/SyndicationService.asmx/GetEntryCommentsRss?guid=ad80e255-0b77-4759-86c2-5ae5eef8da53</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <img title="FieldRenderer control being added to the page using the Sitecore Page Designer" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 0px 10px 10px; border-right-width: 0px" height="359" alt="FieldRenderer control being added to the page using the Sitecore Page Designer" src="http://www.alexeyrusakov.com/sitecoreblog/content/binary/RenderingFieldsinSitecore6using.NET_13DF0/image.png" width="318" align="right" border="0" />In
the <a href="http://alexeyrusakov.com/sitecoreblog/2008/09/15/The+RenderField+Pipeline.aspx">last
post</a> I’ve mentioned the new ways of rendering fields using .NET code using web
controls. Today I’ll focus on them more closely.
</p>
        <p>
The purpose for introducing these controls is two-fold: to allow .NET developers enjoy
the same simplicity of rendering various Sitecore field types available in the XSL
world, and to support the Page Editor.
</p>
        <p>
The most notable addition is the <em>Sitecore.Web.UI.WebControls.FieldRenderer</em> web
control. This is basically a <em>renderField</em> pipeline wrapped in a web control
form. You need to at least specify the field name and the control will do the rest.
Optional parameters include the context item, html to render before and after the
field and additional parameters. Another useful thing about FieldRenderer is that
it’s also registered as a web control rendering in Sitecore, which allows power users
to output different field types right from the Page Designer.
</p>
        <p>
The same FieldRenderer class also contains a static shortcut render method: <em>Render(Item
item, string fieldName [, string parameters]): string</em>. This is the easiest way
to render a field – use it when having web control is not desirable, and you’d rather
just get result as a string. 
</p>
        <p>
Along with FieldRenderer we’ve also introduced a number of web controls tailored to
render specific field types:
</p>
        <p>
Sitecore.Web.UI.WebControls.<em>Date</em><br />
Sitecore.Web.UI.WebControls.<em>Image</em><br />
Sitecore.Web.UI.WebControls.<em>Link</em><br />
Sitecore.Web.UI.WebControls.<em>Text</em></p>
        <p>
        </p>
        <p>
        </p>
        <p>
The benefit of these controls is that they provide strongly typed properties, similar
to the ones available in their XSL counterparts. For example the Image web control
has Alt, MaxHeight and MaxWidth properties. If you want to use these controls but
still just get a string as a result, use the <em>Sitecore.Web.HtmlUtil.RenderControl(Control):string</em> convenience
method.
</p>
        <p>
The most important thing to remember is that if you’re using .NET code to output field
values, you have to use one of the above ways to support the Page Editor , because
something like Response.Write(item[“FieldName”]) just won’t do it.
</p>
        <img width="0" height="0" src="http://alexeyrusakov.com/sitecoreblog/aggbug.ashx?id=ad80e255-0b77-4759-86c2-5ae5eef8da53" />
      <xhtml:img xmlns:xhtml="http://www.w3.org/1999/xhtml" src="http://feeds.feedburner.com/~r/alexeyrusakov/sitecore/~4/395881469" height="1" width="1" /></body>
      <title>Rendering Fields in Sitecore 6 using .NET</title>
      <guid isPermaLink="false">http://alexeyrusakov.com/sitecoreblog/PermaLink,guid,ad80e255-0b77-4759-86c2-5ae5eef8da53.aspx</guid>
      <link>http://alexeyrusakov.com/sitecoreblog/2008/09/18/Rendering+Fields+In+Sitecore+6+Using+NET.aspx</link>
      <pubDate>Thu, 18 Sep 2008 04:45:29 GMT</pubDate>
      <description>&lt;p&gt;
&lt;img title="FieldRenderer control being added to the page using the Sitecore Page Designer" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 0px 10px 10px; border-right-width: 0px" height="359" alt="FieldRenderer control being added to the page using the Sitecore Page Designer" src="http://www.alexeyrusakov.com/sitecoreblog/content/binary/RenderingFieldsinSitecore6using.NET_13DF0/image.png" width="318" align="right" border="0"&gt;In
the &lt;a href="http://alexeyrusakov.com/sitecoreblog/2008/09/15/The+RenderField+Pipeline.aspx"&gt;last
post&lt;/a&gt; I’ve mentioned the new ways of rendering fields using .NET code using web
controls. Today I’ll focus on them more closely.
&lt;/p&gt;
&lt;p&gt;
The purpose for introducing these controls is two-fold: to allow .NET developers enjoy
the same simplicity of rendering various Sitecore field types available in the XSL
world, and to support the Page Editor.
&lt;/p&gt;
&lt;p&gt;
The most notable addition is the &lt;em&gt;Sitecore.Web.UI.WebControls.FieldRenderer&lt;/em&gt; web
control. This is basically a &lt;em&gt;renderField&lt;/em&gt; pipeline wrapped in a web control
form. You need to at least specify the field name and the control will do the rest.
Optional parameters include the context item, html to render before and after the
field and additional parameters. Another useful thing about FieldRenderer is that
it’s also registered as a web control rendering in Sitecore, which allows power users
to output different field types right from the Page Designer.
&lt;/p&gt;
&lt;p&gt;
The same FieldRenderer class also contains a static shortcut render method: &lt;em&gt;Render(Item
item, string fieldName [, string parameters]): string&lt;/em&gt;. This is the easiest way
to render a field – use it when having web control is not desirable, and you’d rather
just get result as a string. 
&lt;/p&gt;
&lt;p&gt;
Along with FieldRenderer we’ve also introduced a number of web controls tailored to
render specific field types:
&lt;/p&gt;
&lt;p&gt;
Sitecore.Web.UI.WebControls.&lt;em&gt;Date&lt;/em&gt;
&lt;br&gt;
Sitecore.Web.UI.WebControls.&lt;em&gt;Image&lt;/em&gt;
&lt;br&gt;
Sitecore.Web.UI.WebControls.&lt;em&gt;Link&lt;/em&gt;
&lt;br&gt;
Sitecore.Web.UI.WebControls.&lt;em&gt;Text&lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
The benefit of these controls is that they provide strongly typed properties, similar
to the ones available in their XSL counterparts. For example the Image web control
has Alt, MaxHeight and MaxWidth properties. If you want to use these controls but
still just get a string as a result, use the &lt;em&gt;Sitecore.Web.HtmlUtil.RenderControl(Control):string&lt;/em&gt; convenience
method.
&lt;/p&gt;
&lt;p&gt;
The most important thing to remember is that if you’re using .NET code to output field
values, you have to use one of the above ways to support the Page Editor , because
something like Response.Write(item[“FieldName”]) just won’t do it.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://alexeyrusakov.com/sitecoreblog/aggbug.ashx?id=ad80e255-0b77-4759-86c2-5ae5eef8da53" /&gt;</description>
      <comments>http://alexeyrusakov.com/sitecoreblog/CommentView,guid,ad80e255-0b77-4759-86c2-5ae5eef8da53.aspx</comments>
      <category>Sitecore</category>
      <category>Sitecore/Crestone</category>
    </item>
    <item>
      <trackback:ping>http://alexeyrusakov.com/sitecoreblog/Trackback.aspx?guid=f2e52fec-7c8a-416d-8a5d-acc498901b64</trackback:ping>
      <pingback:server>http://alexeyrusakov.com/sitecoreblog/pingback.aspx</pingback:server>
      <pingback:target>http://alexeyrusakov.com/sitecoreblog/PermaLink,guid,f2e52fec-7c8a-416d-8a5d-acc498901b64.aspx</pingback:target>
      <dc:creator>Alexey Rusakov</dc:creator>
      <wfw:comment>http://alexeyrusakov.com/sitecoreblog/CommentView,guid,f2e52fec-7c8a-416d-8a5d-acc498901b64.aspx</wfw:comment>
      <wfw:commentRss>http://alexeyrusakov.com/sitecoreblog/SyndicationService.asmx/GetEntryCommentsRss?guid=f2e52fec-7c8a-416d-8a5d-acc498901b64</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Sitecore’s <em>renderField</em> pipeline is a supporting pillar for the Page Editor.
The pipeline ties together XSL and .NET field rendering code into one and provides
a single place to affect how each field type (rich text, image, link) is rendered
on the website.
</p>
        <p>
It doesn’t matter if the field is being output using XSL extension methods (sc:field,
sc:image), XSL controls (&lt;sc:text /&gt;, &lt;sc:image /&gt;) or the new family
of .NET web controls (Sitecore.Web.UI.WebControls.FieldRenderer, Date, Image, etc)
– the renderField pipeline is always the one that provides the actual output. 
</p>
        <p>
How does this support the Page Editor? Whenever a page is being run in the page editor
mode, the renderField pipeline knows that and renders additional html/javascript around
each field. 
</p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
How is the pipeline useful to you? The ability to hook into a field rendering process
and modify the look of any field on a website is a powerful feature. For example you
could completely change the way some or all images are rendered, or merely postprocess
the rich text fields, like in the following example. This pipeline would also interest
implementers of new field types, because it’s now possible to teach standard output
methods to render third party fields types.
</p>
        <p>
The code below checks all links rendered as a part of the rich text field and adds
the “external” CSS class to all external links. This can be useful to style external
links differently, like using different colors or adding an icon next to them.
</p>
        <pre>public class MarkExternalLinks {
  public void Process(RenderFieldArgs args) {
    if (args.FieldTypeKey != "html" &amp;&amp; args.FieldTypeKey != "rich text") {
      return;
    }

    if (!args.Result.ToString().ToLower().Contains("&lt;a")) {
      return;
    }

    var firstPart = new HtmlDocument();
    firstPart.LoadHtml(args.Result.FirstPart);
    MarkLinks(firstPart);
    args.Result.FirstPart = firstPart.DocumentNode.OuterHtml;
  }

  private void MarkLinks(HtmlDocument document) {
    var nodes = document.DocumentNode.SelectNodes("//a");
    if (nodes == null || nodes.Count == 0) {
      return;
    }

    foreach (var node in nodes) {
      if (node.GetAttributeValue("href", string.Empty).Contains("http")) {
        var className = node.GetAttributeValue("class", string.Empty);
        if (className.Length &gt; 0) {
          className += " ";
        }

        className += "external";
        node.SetAttributeValue("class", className);
      }
    }
  }
}
</pre>
        <p>
OK, what happens here? First, the check for the field type is performed. This processor
is only designed to alter the output of <em>html</em> and <em>rich text</em> fields.
If the field contains any links, output is being processed using the Html Agility
Pack. The rendered field is stored in args.Result. The reason for having both FirstPart
and LastPart is to render fields that can have other content embedded in them, such
as <em>general link;</em><em>rich text </em>fields only have the FirstPart.
</p>
        <p>
Now the processor needs to be placed in web.config. I’m putting it just before the
RenderWebEditing processor, so that it doesn’t affect the additional links rendered
to support Page Editor. It’s also important that it comes after the GetLinkFieldValue
processor:
</p>
        <p>
&lt;renderField&gt;<br />
  &lt;processor type="Sitecore.Pipelines.RenderField.GetFieldValue, Sitecore.Kernel"/&gt;<br />
  &lt;processor type="Sitecore.Pipelines.RenderField.ExpandLinks, Sitecore.Kernel"/&gt;<br />
  &lt;processor type="Sitecore.Pipelines.RenderField.GetImageFieldValue, Sitecore.Kernel"/&gt;<br />
  &lt;processor type="Sitecore.Pipelines.RenderField.GetLinkFieldValue, Sitecore.Kernel"/&gt;<br />
  &lt;processor type="Sitecore.Pipelines.RenderField.GetInternalLinkFieldValue,
Sitecore.Kernel"/&gt;<br />
  &lt;processor type="Sitecore.Pipelines.RenderField.GetMemoFieldValue, Sitecore.Kernel"/&gt;<br />
  &lt;processor type="Sitecore.Pipelines.RenderField.GetDateFieldValue, Sitecore.Kernel"/&gt;<br />
  &lt;processor type="Sitecore.Pipelines.RenderField.AddBeforeAndAfterValues,
Sitecore.Kernel"/&gt;<br />
  <strong>&lt;processor type="Pipelines.MarkExternalLinks, Pipelines" /&gt;</strong><br />
  &lt;processor type="Sitecore.Pipelines.RenderField.RenderWebEditing, Sitecore.Kernel"/&gt;<br />
&lt;/renderField&gt; 
</p>
        <p>
Once again, here are the different ways of properly rendering a field:
</p>
        <ol>
          <li>
            <em>sc:field</em> XSL extension method, and the family of field type specific methods
such as the sc:image, sc:link, sc:date and so on 
</li>
          <li>
XSL controls: &lt;sc:text /&gt;, &lt;sc:image /&gt;, &lt;sc:date /&gt; and so on 
</li>
          <li>
The Sitecore.Web.UI.WebControls.FieldRenderer web control, and a family of field type
specific web controls, such as Sitecore.Web.UI.WebControls.Image, Date, etc [new] 
</li>
          <li>
The Sitecore.Web.UI.WebControls.FieldRenderer.Render() shortcut method. Use it when
having the web control is not desirable, and you’d rather just have a string. [new]</li>
        </ol>
        <p>
It’s important to understand when the <em>renderField</em> pipeline is <strong>not
used</strong>:
</p>
        <ol>
          <li>
            <em>sc:fld</em> XSL extension method returns raw field value, bypassing the pipeline. 
</li>
          <li>
Field values read using the Sitecore API (item[“FieldName”] or item.Fields[“FieldName”].Value)
also return raw values. 
</li>
          <li>
Any static html included in the aspx or ascs files is also not processed.</li>
        </ol>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
Consequently, these are also the ways of supporting the new Page Editor in Sitecore
6: as long as you output the field using any of the options from the first list so
that the <em>renderField</em> is used, you’re automatically getting the full Page
Editor support. 
</p>
        <p>
In the next post I’ll focus on the new FieldRenderer web control and the family of
field controls, added to make rendering fields in .NET to be as easy as using XSL
controls.
</p>
        <img width="0" height="0" src="http://alexeyrusakov.com/sitecoreblog/aggbug.ashx?id=f2e52fec-7c8a-416d-8a5d-acc498901b64" />
      <xhtml:img xmlns:xhtml="http://www.w3.org/1999/xhtml" src="http://feeds.feedburner.com/~r/alexeyrusakov/sitecore/~4/392878948" height="1" width="1" /></body>
      <title>The renderField Pipeline</title>
      <guid isPermaLink="false">http://alexeyrusakov.com/sitecoreblog/PermaLink,guid,f2e52fec-7c8a-416d-8a5d-acc498901b64.aspx</guid>
      <link>http://alexeyrusakov.com/sitecoreblog/2008/09/15/The+RenderField+Pipeline.aspx</link>
      <pubDate>Mon, 15 Sep 2008 04:33:45 GMT</pubDate>
      <description>&lt;p&gt;
Sitecore’s &lt;em&gt;renderField&lt;/em&gt; pipeline is a supporting pillar for the Page Editor.
The pipeline ties together XSL and .NET field rendering code into one and provides
a single place to affect how each field type (rich text, image, link) is rendered
on the website.
&lt;/p&gt;
&lt;p&gt;
It doesn’t matter if the field is being output using XSL extension methods (sc:field,
sc:image), XSL controls (&amp;lt;sc:text /&amp;gt;, &amp;lt;sc:image /&amp;gt;) or the new family
of .NET web controls (Sitecore.Web.UI.WebControls.FieldRenderer, Date, Image, etc)
– the renderField pipeline is always the one that provides the actual output. 
&lt;/p&gt;
&lt;p&gt;
How does this support the Page Editor? Whenever a page is being run in the page editor
mode, the renderField pipeline knows that and renders additional html/javascript around
each field. 
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
How is the pipeline useful to you? The ability to hook into a field rendering process
and modify the look of any field on a website is a powerful feature. For example you
could completely change the way some or all images are rendered, or merely postprocess
the rich text fields, like in the following example. This pipeline would also interest
implementers of new field types, because it’s now possible to teach standard output
methods to render third party fields types.
&lt;/p&gt;
&lt;p&gt;
The code below checks all links rendered as a part of the rich text field and adds
the “external” CSS class to all external links. This can be useful to style external
links differently, like using different colors or adding an icon next to them.
&lt;/p&gt;
&lt;pre&gt;public class MarkExternalLinks {
  public void Process(RenderFieldArgs args) {
    if (args.FieldTypeKey != "html" &amp;amp;&amp;amp; args.FieldTypeKey != "rich text") {
      return;
    }

    if (!args.Result.ToString().ToLower().Contains("&amp;lt;a")) {
      return;
    }

    var firstPart = new HtmlDocument();
    firstPart.LoadHtml(args.Result.FirstPart);
    MarkLinks(firstPart);
    args.Result.FirstPart = firstPart.DocumentNode.OuterHtml;
  }

  private void MarkLinks(HtmlDocument document) {
    var nodes = document.DocumentNode.SelectNodes("//a");
    if (nodes == null || nodes.Count == 0) {
      return;
    }

    foreach (var node in nodes) {
      if (node.GetAttributeValue("href", string.Empty).Contains("http")) {
        var className = node.GetAttributeValue("class", string.Empty);
        if (className.Length &amp;gt; 0) {
          className += " ";
        }

        className += "external";
        node.SetAttributeValue("class", className);
      }
    }
  }
}
&lt;/pre&gt;
&lt;p&gt;
OK, what happens here? First, the check for the field type is performed. This processor
is only designed to alter the output of &lt;em&gt;html&lt;/em&gt; and &lt;em&gt;rich text&lt;/em&gt; fields.
If the field contains any links, output is being processed using the Html Agility
Pack. The rendered field is stored in args.Result. The reason for having both FirstPart
and LastPart is to render fields that can have other content embedded in them, such
as &lt;em&gt;general link;&lt;/em&gt; &lt;em&gt;rich text &lt;/em&gt;fields only have the FirstPart.
&lt;/p&gt;
&lt;p&gt;
Now the processor needs to be placed in web.config. I’m putting it just before the
RenderWebEditing processor, so that it doesn’t affect the additional links rendered
to support Page Editor. It’s also important that it comes after the GetLinkFieldValue
processor:
&lt;/p&gt;
&lt;p&gt;
&amp;lt;renderField&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;processor type="Sitecore.Pipelines.RenderField.GetFieldValue, Sitecore.Kernel"/&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;processor type="Sitecore.Pipelines.RenderField.ExpandLinks, Sitecore.Kernel"/&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;processor type="Sitecore.Pipelines.RenderField.GetImageFieldValue, Sitecore.Kernel"/&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;processor type="Sitecore.Pipelines.RenderField.GetLinkFieldValue, Sitecore.Kernel"/&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;processor type="Sitecore.Pipelines.RenderField.GetInternalLinkFieldValue,
Sitecore.Kernel"/&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;processor type="Sitecore.Pipelines.RenderField.GetMemoFieldValue, Sitecore.Kernel"/&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;processor type="Sitecore.Pipelines.RenderField.GetDateFieldValue, Sitecore.Kernel"/&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;processor type="Sitecore.Pipelines.RenderField.AddBeforeAndAfterValues,
Sitecore.Kernel"/&amp;gt;&lt;br&gt;
&amp;nbsp; &lt;strong&gt;&amp;lt;processor type="Pipelines.MarkExternalLinks, Pipelines" /&amp;gt;&lt;/strong&gt;
&lt;br&gt;
&amp;nbsp; &amp;lt;processor type="Sitecore.Pipelines.RenderField.RenderWebEditing, Sitecore.Kernel"/&amp;gt;&lt;br&gt;
&amp;lt;/renderField&amp;gt; 
&lt;p&gt;
Once again, here are the different ways of properly rendering a field:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;em&gt;sc:field&lt;/em&gt; XSL extension method, and the family of field type specific methods
such as the sc:image, sc:link, sc:date and so on 
&lt;li&gt;
XSL controls: &amp;lt;sc:text /&amp;gt;, &amp;lt;sc:image /&amp;gt;, &amp;lt;sc:date /&amp;gt; and so on 
&lt;li&gt;
The Sitecore.Web.UI.WebControls.FieldRenderer web control, and a family of field type
specific web controls, such as Sitecore.Web.UI.WebControls.Image, Date, etc [new] 
&lt;li&gt;
The Sitecore.Web.UI.WebControls.FieldRenderer.Render() shortcut method. Use it when
having the web control is not desirable, and you’d rather just have a string. [new]&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
It’s important to understand when the &lt;em&gt;renderField&lt;/em&gt; pipeline is &lt;strong&gt;not
used&lt;/strong&gt;:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;em&gt;sc:fld&lt;/em&gt; XSL extension method returns raw field value, bypassing the pipeline. 
&lt;li&gt;
Field values read using the Sitecore API (item[“FieldName”] or item.Fields[“FieldName”].Value)
also return raw values. 
&lt;li&gt;
Any static html included in the aspx or ascs files is also not processed.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
Consequently, these are also the ways of supporting the new Page Editor in Sitecore
6: as long as you output the field using any of the options from the first list so
that the &lt;em&gt;renderField&lt;/em&gt; is used, you’re automatically getting the full Page
Editor support. 
&lt;/p&gt;
&lt;p&gt;
In the next post I’ll focus on the new FieldRenderer web control and the family of
field controls, added to make rendering fields in .NET to be as easy as using XSL
controls.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://alexeyrusakov.com/sitecoreblog/aggbug.ashx?id=f2e52fec-7c8a-416d-8a5d-acc498901b64" /&gt;</description>
      <comments>http://alexeyrusakov.com/sitecoreblog/CommentView,guid,f2e52fec-7c8a-416d-8a5d-acc498901b64.aspx</comments>
      <category>Sitecore</category>
      <category>Sitecore/Crestone</category>
    </item>
    <item>
      <trackback:ping>http://alexeyrusakov.com/sitecoreblog/Trackback.aspx?guid=d46c6185-8991-4148-a273-603ff0da5326</trackback:ping>
      <pingback:server>http://alexeyrusakov.com/sitecoreblog/pingback.aspx</pingback:server>
      <pingback:target>http://alexeyrusakov.com/sitecoreblog/PermaLink,guid,d46c6185-8991-4148-a273-603ff0da5326.aspx</pingback:target>
      <dc:creator>Alexey Rusakov</dc:creator>
      <wfw:comment>http://alexeyrusakov.com/sitecoreblog/CommentView,guid,d46c6185-8991-4148-a273-603ff0da5326.aspx</wfw:comment>
      <wfw:commentRss>http://alexeyrusakov.com/sitecoreblog/SyndicationService.asmx/GetEntryCommentsRss?guid=d46c6185-8991-4148-a273-603ff0da5326</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I’m on vacation in Copenhagen, on 7-10th of September (i.e. next week).
</p>
        <p>
I’ll be checking email from time to time: “alexey at this domain dotcom”.
</p>
        <img width="0" height="0" src="http://alexeyrusakov.com/sitecoreblog/aggbug.ashx?id=d46c6185-8991-4148-a273-603ff0da5326" />
      <xhtml:img xmlns:xhtml="http://www.w3.org/1999/xhtml" src="http://feeds.feedburner.com/~r/alexeyrusakov/sitecore/~4/382511303" height="1" width="1" /></body>
      <title>Vacation</title>
      <guid isPermaLink="false">http://alexeyrusakov.com/sitecoreblog/PermaLink,guid,d46c6185-8991-4148-a273-603ff0da5326.aspx</guid>
      <link>http://alexeyrusakov.com/sitecoreblog/2008/09/03/Vacation.aspx</link>
      <pubDate>Wed, 03 Sep 2008 17:11:26 GMT</pubDate>
      <description>&lt;p&gt;
I’m on vacation in Copenhagen, on 7-10th of September (i.e. next week).
&lt;/p&gt;
&lt;p&gt;
I’ll be checking email from time to time: “alexey at this domain dotcom”.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://alexeyrusakov.com/sitecoreblog/aggbug.ashx?id=d46c6185-8991-4148-a273-603ff0da5326" /&gt;</description>
      <comments>http://alexeyrusakov.com/sitecoreblog/CommentView,guid,d46c6185-8991-4148-a273-603ff0da5326.aspx</comments>
      <category>Personal</category>
    </item>
    <item>
      <trackback:ping>http://alexeyrusakov.com/sitecoreblog/Trackback.aspx?guid=7ed9024d-250a-4930-bd84-ebaed3e2d9b9</trackback:ping>
      <pingback:server>http://alexeyrusakov.com/sitecoreblog/pingback.aspx</pingback:server>
      <pingback:target>http://alexeyrusakov.com/sitecoreblog/PermaLink,guid,7ed9024d-250a-4930-bd84-ebaed3e2d9b9.aspx</pingback:target>
      <dc:creator>Alexey Rusakov</dc:creator>
      <wfw:comment>http://alexeyrusakov.com/sitecoreblog/CommentView,guid,7ed9024d-250a-4930-bd84-ebaed3e2d9b9.aspx</wfw:comment>
      <wfw:commentRss>http://alexeyrusakov.com/sitecoreblog/SyndicationService.asmx/GetEntryCommentsRss?guid=7ed9024d-250a-4930-bd84-ebaed3e2d9b9</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Sitecore CMS 6.0.0 Update rev.080820 is released: <a title="http://sdn5.sitecore.net/SDN5/Resources/Sitecore%206/Sitecore%206.0.aspx" href="http://sdn5.sitecore.net/SDN5/Resources/Sitecore%206/Sitecore%206.0.aspx">http://sdn5.sitecore.net/SDN5/Resources/Sitecore%206/Sitecore%206.0.aspx</a>. 
</p>
        <p>
The most notable fix is .NET 3.5 Service Pack 1 compatibility.
</p>
        <img width="0" height="0" src="http://alexeyrusakov.com/sitecoreblog/aggbug.ashx?id=7ed9024d-250a-4930-bd84-ebaed3e2d9b9" />
      <xhtml:img xmlns:xhtml="http://www.w3.org/1999/xhtml" src="http://feeds.feedburner.com/~r/alexeyrusakov/sitecore/~4/380272856" height="1" width="1" /></body>
      <title>A Fix for .NET 3.5 Service Pack 1</title>
      <guid isPermaLink="false">http://alexeyrusakov.com/sitecoreblog/PermaLink,guid,7ed9024d-250a-4930-bd84-ebaed3e2d9b9.aspx</guid>
      <link>http://alexeyrusakov.com/sitecoreblog/2008/09/01/A+Fix+For+NET+35+Service+Pack+1.aspx</link>
      <pubDate>Mon, 01 Sep 2008 07:36:19 GMT</pubDate>
      <description>&lt;p&gt;
Sitecore CMS 6.0.0 Update rev.080820 is released: &lt;a title="http://sdn5.sitecore.net/SDN5/Resources/Sitecore%206/Sitecore%206.0.aspx" href="http://sdn5.sitecore.net/SDN5/Resources/Sitecore%206/Sitecore%206.0.aspx"&gt;http://sdn5.sitecore.net/SDN5/Resources/Sitecore%206/Sitecore%206.0.aspx&lt;/a&gt;. 
&lt;/p&gt;
&lt;p&gt;
The most notable fix is .NET 3.5 Service Pack 1 compatibility.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://alexeyrusakov.com/sitecoreblog/aggbug.ashx?id=7ed9024d-250a-4930-bd84-ebaed3e2d9b9" /&gt;</description>
      <comments>http://alexeyrusakov.com/sitecoreblog/CommentView,guid,7ed9024d-250a-4930-bd84-ebaed3e2d9b9.aspx</comments>
      <category>ASP.NET</category>
      <category>Sitecore</category>
      <category>Sitecore/Crestone</category>
    </item>
    <item>
      <trackback:ping>http://alexeyrusakov.com/sitecoreblog/Trackback.aspx?guid=f9542aee-1756-4da5-936b-f2e6d0d2d4cb</trackback:ping>
      <pingback:server>http://alexeyrusakov.com/sitecoreblog/pingback.aspx</pingback:server>
      <pingback:target>http://alexeyrusakov.com/sitecoreblog/PermaLink,guid,f9542aee-1756-4da5-936b-f2e6d0d2d4cb.aspx</pingback:target>
      <dc:creator>Alexey Rusakov</dc:creator>
      <wfw:comment>http://alexeyrusakov.com/sitecoreblog/CommentView,guid,f9542aee-1756-4da5-936b-f2e6d0d2d4cb.aspx</wfw:comment>
      <wfw:commentRss>http://alexeyrusakov.com/sitecoreblog/SyndicationService.asmx/GetEntryCommentsRss?guid=f9542aee-1756-4da5-936b-f2e6d0d2d4cb</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <img title="Sitecore Content Editor shortcuts as revealed by Alt-F1" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 0px 10px 10px; border-right-width: 0px" height="104" alt="Sitecore Content Editor shortcuts as revealed by Alt-F1" src="http://www.alexeyrusakov.com/sitecoreblog/content/binary/SitecoreKeyboardShortcuts_10EB8/image.png" width="379" align="right" border="0" /> Sitecore
comes with some keyboard shortcuts predefined. The purpose of this post is to compile
a full list of these shortcuts and for a little extra, show how to define new ones.
</p>
        <h3>Global Shortcuts
</h3>
        <p>
          <strong>F9</strong> – Publish<br /><strong>F2</strong> – Expose (tiles all windows so that you can select the one you
need)<br /><strong>Ctrl+/</strong> – Focus in the startbar search<br /></p>
        <h3>Content Editor Shortcuts
</h3>
        <p>
Tabs (hover over each tab to reveal the shortcut):
</p>
        <p>
          <strong>Alt+H</strong> – Home<br /><strong>Alt+N</strong> – Navigate<br /><strong>Alt+R</strong> – Review<br /><strong>Alt+P</strong> – Publish<br /><strong>Alt+V</strong> – Versions<br /><strong>Alt+C</strong> – Configure<br /><strong>Alt+E</strong> – Presentation<br /><strong>Alt+S</strong> – Security<br /><strong>Alt+I</strong> - View
</p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
Some ribbon commands have direct shortcuts. Most important one is <strong>Alt+F1</strong>,
which reveals the shortcuts assigned to ribbon buttons:
</p>
        <p>
          <strong>F2</strong> – Rename<br /><strong>F7</strong> – Validation<br /><strong>F8</strong> – Edit (Lock / Unlock)<br /><br /><strong>Ctrl+S</strong> – Save<br /><strong>Ctrl+D</strong> – Duplicate<br /><br /><strong>Ctrl+Shift+F</strong> – Launch the search application<br /><strong>Ctrl+Shift+Home</strong> – Move to the Home  item<br /><strong>Ctrl+Shift+Alt+L</strong> – Protect / Unprotect<br /><br /><strong>Ctrl+Shift+Alt+Up</strong> – Sort Up<br /><strong>Ctrl+Shift+Alt+Down</strong> – Sort Down<br /></p>
        <h3>Assigning New Ribbon Shortcuts
</h3>
        <p>
          <img title="c83 keycode assigned to the Save command in the Content Editor ribbon" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="65" alt="c83 keycode assigned to the Save command in the Content Editor ribbon" src="http://www.alexeyrusakov.com/sitecoreblog/content/binary/SitecoreKeyboardShortcuts_10EB8/image_3.png" width="333" align="right" border="0" /> Each
item representing a ribbon button has a KeyCode field, accepting a shortcut string.
How to build this shortcut string?
</p>
        <p>
First, you need to know they keycode corresponding to each key. This is the code used
by the javascript event model, and here you can find a <a href="http://webonweboff.com/tips/js/event_key_codes.aspx">list
of these keycodes</a>. Then, if Shift, Control or Alt buttons are involved in the
shortcut, prepend the code with “s”, “c” and “a”  respectively.
</p>
        <p>
Examples: <strong>Ctrl+S</strong> is translated into c83 - <em>c</em> for control, <em>83</em> for
“s”. <strong>Ctrl+Shift+Alt+Down</strong> is sca40 – <em>s</em> for Shift, <em>c</em> for
Control, <em>a</em> for Alt and <em>40</em> is the keycode for the down key.<br /><br />
As an exercise, lets assign a shortcut to start the page editor. Page Editor button
belongs to the <em>Publish</em> chunk in the Content Editor ribbon. So switch to the
core database, and go to the /sitecore/content/Applications/Content Editor/Ribbons/Chunks/Publish/Page
Editor.
</p>
        <p>
The shortcut I want for the Page Editor is <strong>Ctrl+Shift+E</strong>. This translates
into sc69 shortcut string (<em>s</em> for Shift, <em>c</em> for Control and 69 is
the keycode of “<em>e”</em>), so write “sc69” in the KeyCode field. 
</p>
        <p>
          <a href="http://www.alexeyrusakov.com/sitecoreblog/content/binary/SitecoreKeyboardShortcuts_10EB8/image_4.png">
            <img title="image" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 10px 10px 0px; border-right-width: 0px" height="92" alt="image" src="http://www.alexeyrusakov.com/sitecoreblog/content/binary/SitecoreKeyboardShortcuts_10EB8/image_thumb.png" width="244" align="right" border="0" />
          </a>
        </p>
        <p>
That’s it. Not only pressing Ctrl+Shift+E will start the page editor from now on,
but pressing Alt+F1 will also reveal the shortcut along with the ones that came predefined
with Sitecore.
</p>
        <img width="0" height="0" src="http://alexeyrusakov.com/sitecoreblog/aggbug.ashx?id=f9542aee-1756-4da5-936b-f2e6d0d2d4cb" />
      <xhtml:img xmlns:xhtml="http://www.w3.org/1999/xhtml" src="http://feeds.feedburner.com/~r/alexeyrusakov/sitecore/~4/380194112" height="1" width="1" /></body>
      <title>The Complete Guide to Sitecore Keyboard Shortcuts</title>
      <guid isPermaLink="false">http://alexeyrusakov.com/sitecoreblog/PermaLink,guid,f9542aee-1756-4da5-936b-f2e6d0d2d4cb.aspx</guid>
      <link>http://alexeyrusakov.com/sitecoreblog/2008/09/01/The+Complete+Guide+To+Sitecore+Keyboard+Shortcuts.aspx</link>
      <pubDate>Mon, 01 Sep 2008 04:52:17 GMT</pubDate>
      <description>&lt;p&gt;
&lt;img title="Sitecore Content Editor shortcuts as revealed by Alt-F1" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 0px 10px 10px; border-right-width: 0px" height="104" alt="Sitecore Content Editor shortcuts as revealed by Alt-F1" src="http://www.alexeyrusakov.com/sitecoreblog/content/binary/SitecoreKeyboardShortcuts_10EB8/image.png" width="379" align="right" border="0"&gt; Sitecore
comes with some keyboard shortcuts predefined. The purpose of this post is to compile
a full list of these shortcuts and for a little extra, show how to define new ones.
&lt;/p&gt;
&lt;h3&gt;Global Shortcuts
&lt;/h3&gt;
&lt;p&gt;
&lt;strong&gt;F9&lt;/strong&gt; – Publish&lt;br&gt;
&lt;strong&gt;F2&lt;/strong&gt; – Expose (tiles all windows so that you can select the one you
need)&lt;br&gt;
&lt;strong&gt;Ctrl+/&lt;/strong&gt; – Focus in the startbar search&lt;br&gt;
&lt;/p&gt;
&lt;h3&gt;Content Editor Shortcuts
&lt;/h3&gt;
&lt;p&gt;
Tabs (hover over each tab to reveal the shortcut):
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Alt+H&lt;/strong&gt; – Home&lt;br&gt;
&lt;strong&gt;Alt+N&lt;/strong&gt; – Navigate&lt;br&gt;
&lt;strong&gt;Alt+R&lt;/strong&gt; – Review&lt;br&gt;
&lt;strong&gt;Alt+P&lt;/strong&gt; – Publish&lt;br&gt;
&lt;strong&gt;Alt+V&lt;/strong&gt; – Versions&lt;br&gt;
&lt;strong&gt;Alt+C&lt;/strong&gt; – Configure&lt;br&gt;
&lt;strong&gt;Alt+E&lt;/strong&gt; – Presentation&lt;br&gt;
&lt;strong&gt;Alt+S&lt;/strong&gt; – Security&lt;br&gt;
&lt;strong&gt;Alt+I&lt;/strong&gt; - View
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
Some ribbon commands have direct shortcuts. Most important one is &lt;strong&gt;Alt+F1&lt;/strong&gt;,
which reveals the shortcuts assigned to ribbon buttons:
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;F2&lt;/strong&gt; – Rename&lt;br&gt;
&lt;strong&gt;F7&lt;/strong&gt; – Validation&lt;br&gt;
&lt;strong&gt;F8&lt;/strong&gt; – Edit (Lock / Unlock)&lt;br&gt;
&lt;br&gt;
&lt;strong&gt;Ctrl+S&lt;/strong&gt; – Save&lt;br&gt;
&lt;strong&gt;Ctrl+D&lt;/strong&gt; – Duplicate&lt;br&gt;
&lt;br&gt;
&lt;strong&gt;Ctrl+Shift+F&lt;/strong&gt; – Launch the search application&lt;br&gt;
&lt;strong&gt;Ctrl+Shift+Home&lt;/strong&gt; – Move to the Home&amp;nbsp; item&lt;br&gt;
&lt;strong&gt;Ctrl+Shift+Alt+L&lt;/strong&gt; – Protect / Unprotect&lt;br&gt;
&lt;br&gt;
&lt;strong&gt;Ctrl+Shift+Alt+Up&lt;/strong&gt; – Sort Up&lt;br&gt;
&lt;strong&gt;Ctrl+Shift+Alt+Down&lt;/strong&gt; – Sort Down&lt;br&gt;
&lt;/p&gt;
&lt;h3&gt;Assigning New Ribbon Shortcuts
&lt;/h3&gt;
&lt;p&gt;
&lt;img title="c83 keycode assigned to the Save command in the Content Editor ribbon" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="65" alt="c83 keycode assigned to the Save command in the Content Editor ribbon" src="http://www.alexeyrusakov.com/sitecoreblog/content/binary/SitecoreKeyboardShortcuts_10EB8/image_3.png" width="333" align="right" border="0"&gt; Each
item representing a ribbon button has a KeyCode field, accepting a shortcut string.
How to build this shortcut string?
&lt;/p&gt;
&lt;p&gt;
First, you need to know they keycode corresponding to each key. This is the code used
by the javascript event model, and here you can find a &lt;a href="http://webonweboff.com/tips/js/event_key_codes.aspx"&gt;list
of these keycodes&lt;/a&gt;. Then, if Shift, Control or Alt buttons are involved in the
shortcut, prepend the code with “s”, “c” and “a”&amp;nbsp; respectively.
&lt;/p&gt;
&lt;p&gt;
Examples: &lt;strong&gt;Ctrl+S&lt;/strong&gt; is translated into c83 - &lt;em&gt;c&lt;/em&gt; for control, &lt;em&gt;83&lt;/em&gt; for
“s”. &lt;strong&gt;Ctrl+Shift+Alt+Down&lt;/strong&gt; is sca40 – &lt;em&gt;s&lt;/em&gt; for Shift, &lt;em&gt;c&lt;/em&gt; for
Control, &lt;em&gt;a&lt;/em&gt; for Alt and &lt;em&gt;40&lt;/em&gt; is the keycode for the down key.&lt;br&gt;
&lt;br&gt;
As an exercise, lets assign a shortcut to start the page editor. Page Editor button
belongs to the &lt;em&gt;Publish&lt;/em&gt; chunk in the Content Editor ribbon. So switch to the
core database, and go to the /sitecore/content/Applications/Content Editor/Ribbons/Chunks/Publish/Page
Editor.
&lt;/p&gt;
&lt;p&gt;
The shortcut I want for the Page Editor is &lt;strong&gt;Ctrl+Shift+E&lt;/strong&gt;. This translates
into sc69 shortcut string (&lt;em&gt;s&lt;/em&gt; for Shift, &lt;em&gt;c&lt;/em&gt; for Control and 69 is
the keycode of “&lt;em&gt;e”&lt;/em&gt;), so write “sc69” in the KeyCode field. 
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.alexeyrusakov.com/sitecoreblog/content/binary/SitecoreKeyboardShortcuts_10EB8/image_4.png"&gt;&lt;img title="image" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 10px 10px 0px; border-right-width: 0px" height="92" alt="image" src="http://www.alexeyrusakov.com/sitecoreblog/content/binary/SitecoreKeyboardShortcuts_10EB8/image_thumb.png" width="244" align="right" border="0"&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
That’s it. Not only pressing Ctrl+Shift+E will start the page editor from now on,
but pressing Alt+F1 will also reveal the shortcut along with the ones that came predefined
with Sitecore.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://alexeyrusakov.com/sitecoreblog/aggbug.ashx?id=f9542aee-1756-4da5-936b-f2e6d0d2d4cb" /&gt;</description>
      <comments>http://alexeyrusakov.com/sitecoreblog/CommentView,guid,f9542aee-1756-4da5-936b-f2e6d0d2d4cb.aspx</comments>
      <category>Sitecore</category>
    </item>
    <item>
      <trackback:ping>http://alexeyrusakov.com/sitecoreblog/Trackback.aspx?guid=317bdf6e-63ff-40a5-ad3b-71d78962cd79</trackback:ping>
      <pingback:server>http://alexeyrusakov.com/sitecoreblog/pingback.aspx</pingback:server>
      <pingback:target>http://alexeyrusakov.com/sitecoreblog/PermaLink,guid,317bdf6e-63ff-40a5-ad3b-71d78962cd79.aspx</pingback:target>
      <dc:creator>Alexey Rusakov</dc:creator>
      <wfw:comment>http://alexeyrusakov.com/sitecoreblog/CommentView,guid,317bdf6e-63ff-40a5-ad3b-71d78962cd79.aspx</wfw:comment>
      <wfw:commentRss>http://alexeyrusakov.com/sitecoreblog/SyndicationService.asmx/GetEntryCommentsRss?guid=317bdf6e-63ff-40a5-ad3b-71d78962cd79</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <a href="http://labs.mozilla.com/2008/08/introducing-ubiquity/">
            <img title="image" style="border-right: 0px; border-top: 0px; margin: 0px 0px 10px 10px; border-left: 0px; border-bottom: 0px" height="217" alt="image" src="http://alexeyrusakov.com/sitecoreblog/content/binary/WindowsLiveWriter/Ubiquity_AD0F/image_3.png" width="154" align="right" border="0" />
          </a> I’m <strong>really</strong> excited
about ubiquity: <a title="http://labs.mozilla.com/2008/08/introducing-ubiquity/" href="http://labs.mozilla.com/2008/08/introducing-ubiquity/">http://labs.mozilla.com/2008/08/introducing-ubiquity/</a> is
definitely worth a few minutes if you care about where the web is going.
</p>
        <p>
I loved Aza Raskin’s Enso launcher and wrote a few commands for Enso 2 prototype but
it was too buggy to use. I envy mac users because they have quicksilver.
</p>
        <p>
But now Aza, being the head of user experience in Mozilla Labs, has found a perfect
place to push his ideas forward: firefox, the best cross-platform browser. 
</p>
        <img width="0" height="0" src="http://alexeyrusakov.com/sitecoreblog/aggbug.ashx?id=317bdf6e-63ff-40a5-ad3b-71d78962cd79" />
      <xhtml:img xmlns:xhtml="http://www.w3.org/1999/xhtml" src="http://feeds.feedburner.com/~r/alexeyrusakov/sitecore/~4/376030181" height="1" width="1" /></body>
      <title>Ubiquity</title>
      <guid isPermaLink="false">http://alexeyrusakov.com/sitecoreblog/PermaLink,guid,317bdf6e-63ff-40a5-ad3b-71d78962cd79.aspx</guid>
      <link>http://alexeyrusakov.com/sitecoreblog/2008/08/27/Ubiquity.aspx</link>
      <pubDate>Wed, 27 Aug 2008 09:18:25 GMT</pubDate>
      <description>&lt;p&gt;
&lt;a href="http://labs.mozilla.com/2008/08/introducing-ubiquity/"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; margin: 0px 0px 10px 10px; border-left: 0px; border-bottom: 0px" height="217" alt="image" src="http://alexeyrusakov.com/sitecoreblog/content/binary/WindowsLiveWriter/Ubiquity_AD0F/image_3.png" width="154" align="right" border="0"&gt;&lt;/a&gt; I’m &lt;strong&gt;really&lt;/strong&gt; excited
about ubiquity: &lt;a title="http://labs.mozilla.com/2008/08/introducing-ubiquity/" href="http://labs.mozilla.com/2008/08/introducing-ubiquity/"&gt;http://labs.mozilla.com/2008/08/introducing-ubiquity/&lt;/a&gt; is
definitely worth a few minutes if you care about where the web is going.
&lt;/p&gt;
&lt;p&gt;
I loved Aza Raskin’s Enso launcher and wrote a few commands for Enso 2 prototype but
it was too buggy to use. I envy mac users because they have quicksilver.
&lt;/p&gt;
&lt;p&gt;
But now Aza, being the head of user experience in Mozilla Labs, has found a perfect
place to push his ideas forward: firefox, the best cross-platform browser. 
&lt;/p&gt;
&lt;img width="0" height="0" src="http://alexeyrusakov.com/sitecoreblog/aggbug.ashx?id=317bdf6e-63ff-40a5-ad3b-71d78962cd79" /&gt;</description>
      <comments>http://alexeyrusakov.com/sitecoreblog/CommentView,guid,317bdf6e-63ff-40a5-ad3b-71d78962cd79.aspx</comments>
      <category>User Experience</category>
      <category>Web development</category>
    </item>
    <item>
      <trackback:ping>http://alexeyrusakov.com/sitecoreblog/Trackback.aspx?guid=71f5c989-36b6-4b93-a4d3-89dba0601015</trackback:ping>
      <pingback:server>http://alexeyrusakov.com/sitecoreblog/pingback.aspx</pingback:server>
      <pingback:target>http://alexeyrusakov.com/sitecoreblog/PermaLink,guid,71f5c989-36b6-4b93-a4d3-89dba0601015.aspx</pingback:target>
      <dc:creator>Alexey Rusakov</dc:creator>
      <wfw:comment>http://alexeyrusakov.com/sitecoreblog/CommentView,guid,71f5c989-36b6-4b93-a4d3-89dba0601015.aspx</wfw:comment>
      <wfw:commentRss>http://alexeyrusakov.com/sitecoreblog/SyndicationService.asmx/GetEntryCommentsRss?guid=71f5c989-36b6-4b93-a4d3-89dba0601015</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <a href="http://alexeyrusakov.com/sitecoreblog/content/binary/WindowsLiveWriter/UsingPostActionsintheSitecoreInstaller_114A2/image_4.png">
            <img title="Sitecore installation wizard post step" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 0px 10px 10px; border-right-width: 0px" height="154" alt="Sitecore installation wizard post step" src="http://alexeyrusakov.com/sitecoreblog/content/binary/WindowsLiveWriter/UsingPostActionsintheSitecoreInstaller_114A2/image_thumb_1.png" width="433" align="right" border="0" />
          </a>I’m
sure some people have noticed that the Sitecore Package Designer contains a “Post
Step” field. How can that be used and what for?
</p>
        <p>
The Post Step lets you input a method to be run after the package has been installed. 
</p>
        <p>
To make it work, you need a class that either already exists on the target Sitecore
or is in the assembly that is installed with the package.
</p>
        <p>
The class should implement Sitecore.Install.Framework.IPostStep interface that has
a single RunPostStep(ITaskOutput output, NameValueCollection metaData) method.
</p>
        <p>
Your code will run in the “shell” site. What’s more important, it will run in the
background thread, so you cannot use the ClientResponse or SheerResponse methods.
Instead, the output parameter provides a few basic methods of interaction, such as
showing the alert box or a confirm dialog.
</p>
        <p>
Below is a trivial example that renames the home item after the package installation:
</p>
        <pre>public class Sitecore6Patch2 : IPostStep {
  public void Run(ITaskOutput output, NameValueCollection metaData) {
    var home = Context.ContentDatabase.GetItem("/sitecore/content/home");
    if (home != null) {
      home.Name = "Home upgraded";
    }
  }
}
</pre>
        <p>
 
</p>
        <p>
Note: the above example is for Sitecore 6. In Sitecore 5, your class should have a
parameterless RunPostStep method instead, which is also supported in Sitecore 6 for
compatibility purposes.
</p>
        <img width="0" height="0" src="http://alexeyrusakov.com/sitecoreblog/aggbug.ashx?id=71f5c989-36b6-4b93-a4d3-89dba0601015" />
      <xhtml:img xmlns:xhtml="http://www.w3.org/1999/xhtml" src="http://feeds.feedburner.com/~r/alexeyrusakov/sitecore/~4/375166117" height="1" width="1" /></body>
      <title>Using Post Actions in the Sitecore Installer</title>
      <guid isPermaLink="false">http://alexeyrusakov.com/sitecoreblog/PermaLink,guid,71f5c989-36b6-4b93-a4d3-89dba0601015.aspx</guid>
      <link>http://alexeyrusakov.com/sitecoreblog/2008/08/26/Using+Post+Actions+In+The+Sitecore+Installer.aspx</link>
      <pubDate>Tue, 26 Aug 2008 12:01:27 GMT</pubDate>
      <description>&lt;p&gt;
&lt;a href="http://alexeyrusakov.com/sitecoreblog/content/binary/WindowsLiveWriter/UsingPostActionsintheSitecoreInstaller_114A2/image_4.png"&gt;&lt;img title="Sitecore installation wizard post step" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 0px 10px 10px; border-right-width: 0px" height="154" alt="Sitecore installation wizard post step" src="http://alexeyrusakov.com/sitecoreblog/content/binary/WindowsLiveWriter/UsingPostActionsintheSitecoreInstaller_114A2/image_thumb_1.png" width="433" align="right" border="0"&gt;&lt;/a&gt;I’m
sure some people have noticed that the Sitecore Package Designer contains a “Post
Step” field. How can that be used and what for?
&lt;/p&gt;
&lt;p&gt;
The Post Step lets you input a method to be run after the package has been installed. 
&lt;/p&gt;
&lt;p&gt;
To make it work, you need a class that either already exists on the target Sitecore
or is in the assembly that is installed with the package.
&lt;/p&gt;
&lt;p&gt;
The class should implement Sitecore.Install.Framework.IPostStep interface that has
a single RunPostStep(ITaskOutput output, NameValueCollection metaData) method.
&lt;/p&gt;
&lt;p&gt;
Your code will run in the “shell” site. What’s more important, it will run in the
background thread, so you cannot use the ClientResponse or SheerResponse methods.
Instead, the output parameter provides a few basic methods of interaction, such as
showing the alert box or a confirm dialog.
&lt;/p&gt;
&lt;p&gt;
Below is a trivial example that renames the home item after the package installation:
&lt;/p&gt;
&lt;pre&gt;public class Sitecore6Patch2 : IPostStep {
  public void Run(ITaskOutput output, NameValueCollection metaData) {
    var home = Context.ContentDatabase.GetItem("/sitecore/content/home");
    if (home != null) {
      home.Name = "Home upgraded";
    }
  }
}
&lt;/pre&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
Note: the above example is for Sitecore 6. In Sitecore 5, your class should have a
parameterless RunPostStep method instead, which is also supported in Sitecore 6 for
compatibility purposes.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://alexeyrusakov.com/sitecoreblog/aggbug.ashx?id=71f5c989-36b6-4b93-a4d3-89dba0601015" /&gt;</description>
      <comments>http://alexeyrusakov.com/sitecoreblog/CommentView,guid,71f5c989-36b6-4b93-a4d3-89dba0601015.aspx</comments>
      <category>Sitecore</category>
      <category>Sitecore/Crestone</category>
    </item>
    <item>
      <trackback:ping>http://alexeyrusakov.com/sitecoreblog/Trackback.aspx?guid=dde1178d-3527-4627-8e65-3e52c3abf4db</trackback:ping>
      <pingback:server>http://alexeyrusakov.com/sitecoreblog/pingback.aspx</pingback:server>
      <pingback:target>http://alexeyrusakov.com/sitecoreblog/PermaLink,guid,dde1178d-3527-4627-8e65-3e52c3abf4db.aspx</pingback:target>
      <dc:creator>Alexey Rusakov</dc:creator>
      <wfw:comment>http://alexeyrusakov.com/sitecoreblog/CommentView,guid,dde1178d-3527-4627-8e65-3e52c3abf4db.aspx</wfw:comment>
      <wfw:commentRss>http://alexeyrusakov.com/sitecoreblog/SyndicationService.asmx/GetEntryCommentsRss?guid=dde1178d-3527-4627-8e65-3e52c3abf4db</wfw:commentRss>
      <slash:comments>3</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Have you seen or used the <a href="http://sdn5.sitecore.net/Resources/Shared%20Source/Portlets/Poll%20Module.aspx">Sitecore
Poll module</a>? Got any complaints, suggestions or feature requests? Mail <strong>ar</strong> at <strong>sitecore
dot net</strong> or leave them here in comments. The feedback will be put to good
use. Go.
</p>
        <img width="0" height="0" src="http://alexeyrusakov.com/sitecoreblog/aggbug.ashx?id=dde1178d-3527-4627-8e65-3e52c3abf4db" />
      <xhtml:img xmlns:xhtml="http://www.w3.org/1999/xhtml" src="http://feeds.feedburner.com/~r/alexeyrusakov/sitecore/~4/369805462" height="1" width="1" /></body>
      <title>Poll Module Ideas</title>
      <guid isPermaLink="false">http://alexeyrusakov.com/sitecoreblog/PermaLink,guid,dde1178d-3527-4627-8e65-3e52c3abf4db.aspx</guid>
      <link>http://alexeyrusakov.com/sitecoreblog/2008/08/20/Poll+Module+Ideas.aspx</link>
      <pubDate>Wed, 20 Aug 2008 08:56:18 GMT</pubDate>
      <description>&lt;p&gt;
Have you seen or used the &lt;a href="http://sdn5.sitecore.net/Resources/Shared%20Source/Portlets/Poll%20Module.aspx"&gt;Sitecore
Poll module&lt;/a&gt;? Got any complaints, suggestions or feature requests? Mail &lt;strong&gt;ar&lt;/strong&gt; at &lt;strong&gt;sitecore
dot net&lt;/strong&gt; or leave them here in comments. The feedback will be put to good
use. Go.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://alexeyrusakov.com/sitecoreblog/aggbug.ashx?id=dde1178d-3527-4627-8e65-3e52c3abf4db" /&gt;</description>
      <comments>http://alexeyrusakov.com/sitecoreblog/CommentView,guid,dde1178d-3527-4627-8e65-3e52c3abf4db.aspx</comments>
      <category>Sitecore</category>
      <category>Sitecore/Open Source</category>
    </item>
    <item>
      <trackback:ping>http://alexeyrusakov.com/sitecoreblog/Trackback.aspx?guid=6704bf3d-8980-4f29-9ac2-125cff64bb80</trackback:ping>
      <pingback:server>http://alexeyrusakov.com/sitecoreblog/pingback.aspx</pingback:server>
      <pingback:target>http://alexeyrusakov.com/sitecoreblog/PermaLink,guid,6704bf3d-8980-4f29-9ac2-125cff64bb80.aspx</pingback:target>
      <dc:creator>Alexey Rusakov</dc:creator>
      <wfw:comment>http://alexeyrusakov.com/sitecoreblog/CommentView,guid,6704bf3d-8980-4f29-9ac2-125cff64bb80.aspx</wfw:comment>
      <wfw:commentRss>http://alexeyrusakov.com/sitecoreblog/SyndicationService.asmx/GetEntryCommentsRss?guid=6704bf3d-8980-4f29-9ac2-125cff64bb80</wfw:commentRss>
      <slash:comments>4</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
        </p>
        <p>
A little known fact is that Sitecore 6 comes with <a href="http://prototypejs.org/">Prototype</a> and <a href="http://getfirebug.com/lite.html">Firebug
lite</a> preinstalled. Prototype is a mind saving javascript library, and firebug
lite is a helpful javascript instrumentation console replacing dozens of alert(“I’m
here”) calls.
</p>
        <p>
We’d do it for ourselves anyway, but what does it mean for you?
</p>
        <h3>Prototype
</h3>
        <p>
Prototype javascript library is automatically included in Sitecore shell applications
– both native, such as Content Editor, and the custom ones.
</p>
        <p>
This means you can safely use prototype both in your Sitecore customizations, such
as custom fields, and in your own applications. (If you look closely enough, you’ll
see that <a href="http://trac.sitecore.net/FieldTypes/">custom FieldTypes I’ve made
for Crestone</a> shamelessly use prototype whenever possible).
</p>
        <p>
Needless to say that prototype is great and saves a lot of brain cells if you do any
javascript at all. Some great alternatives, such as jQuery, do exist – but if you
don’t use anything at all, I really wonder why. 
</p>
        <p>
If you’re new to prototype and javascript frameworks in general – they have very solid
documentation at <a title="http://prototypejs.org/" href="http://prototypejs.org/">http://prototypejs.org/</a>.
</p>
        <p>
Even more, prototype’s cousin – <a href="http://script.aculo.us/">Scriptaculous</a>,
a javascript UI controls and effects library is also shipped with Sitecore, but is
not included automatically. If you need it, it’s at /sitecore/shell/Controls/Lib/Scriptaculous.
</p>
        <h3>Firebug Lite
</h3>
        <p>
Firebug lite is a cross browser javascript console – the fact that it works in Internet
Explorer is of biggest interest to Sitecore developers. <a href="http://alexeyrusakov.com/sitecoreblog/2007/01/30/Cross+Browser+Javascript+Instrumentation+With+Firebug+Lite.aspx">I’ve
praised it before</a>, but now it’s one key press away in Sitecore shell applications.
</p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
Press F12 and the firebug lite console will pop up from the top:
</p>
        <p>
          <img title="Firebug lite opened in Sitecore Content Editor" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="453" alt="Firebug lite opened in Sitecore Content Editor" src="http://alexeyrusakov.com/sitecoreblog/content/binary/WindowsLiveWriter/JavascriptFriendsofSitecore_8BA7/image_3.png" width="666" border="0" />
        </p>
        <p>
This means you can use console.log and other instrumentation methods to debug your
javascript.
</p>
        <p>
Sitecore UI has a lot of IFrames, so pay attention where you click before opening
the console – each IFrame is a separate javascript realm, and therefore has its own
firebug console.
</p>
        <h3>The Website is Safe
</h3>
        <p>
I’d like to stress again that both Prototype and Firebug lite are only included in
the Sitecore shell applications. Technically, if the sitecore.js javascript file is
loaded, the prototype and firebug are also inlcuded. 
</p>
        <p>
We don’t add anything to the frontend sites – it’s your decision.
</p>
        <img width="0" height="0" src="http://alexeyrusakov.com/sitecoreblog/aggbug.ashx?id=6704bf3d-8980-4f29-9ac2-125cff64bb80" />
      <xhtml:img xmlns:xhtml="http://www.w3.org/1999/xhtml" src="http://feeds.feedburner.com/~r/alexeyrusakov/sitecore/~4/367857435" height="1" width="1" /></body>
      <title>Javascript Friends of Sitecore</title>
      <guid isPermaLink="false">http://alexeyrusakov.com/sitecoreblog/PermaLink,guid,6704bf3d-8980-4f29-9ac2-125cff64bb80.aspx</guid>
      <link>http://alexeyrusakov.com/sitecoreblog/2008/08/18/Javascript+Friends+Of+Sitecore.aspx</link>
      <pubDate>Mon, 18 Aug 2008 06:37:58 GMT</pubDate>
      <description>&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
A little known fact is that Sitecore 6 comes with &lt;a href="http://prototypejs.org/"&gt;Prototype&lt;/a&gt; and &lt;a href="http://getfirebug.com/lite.html"&gt;Firebug
lite&lt;/a&gt; preinstalled. Prototype is a mind saving javascript library, and firebug
lite is a helpful javascript instrumentation console replacing dozens of alert(“I’m
here”) calls.
&lt;/p&gt;
&lt;p&gt;
We’d do it for ourselves anyway, but what does it mean for you?
&lt;/p&gt;
&lt;h3&gt;Prototype
&lt;/h3&gt;
&lt;p&gt;
Prototype javascript library is automatically included in Sitecore shell applications
– both native, such as Content Editor, and the custom ones.
&lt;/p&gt;
&lt;p&gt;
This means you can safely use prototype both in your Sitecore customizations, such
as custom fields, and in your own applications. (If you look closely enough, you’ll
see that &lt;a href="http://trac.sitecore.net/FieldTypes/"&gt;custom FieldTypes I’ve made
for Crestone&lt;/a&gt; shamelessly use prototype whenever possible).
&lt;/p&gt;
&lt;p&gt;
Needless to say that prototype is great and saves a lot of brain cells if you do any
javascript at all. Some great alternatives, such as jQuery, do exist – but if you
don’t use anything at all, I really wonder why. 
&lt;/p&gt;
&lt;p&gt;
If you’re new to prototype and javascript frameworks in general – they have very solid
documentation at &lt;a title="http://prototypejs.org/" href="http://prototypejs.org/"&gt;http://prototypejs.org/&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
Even more, prototype’s cousin – &lt;a href="http://script.aculo.us/"&gt;Scriptaculous&lt;/a&gt;,
a javascript UI controls and effects library is also shipped with Sitecore, but is
not included automatically. If you need it, it’s at /sitecore/shell/Controls/Lib/Scriptaculous.
&lt;/p&gt;
&lt;h3&gt;Firebug Lite
&lt;/h3&gt;
&lt;p&gt;
Firebug lite is a cross browser javascript console – the fact that it works in Internet
Explorer is of biggest interest to Sitecore developers. &lt;a href="http://alexeyrusakov.com/sitecoreblog/2007/01/30/Cross+Browser+Javascript+Instrumentation+With+Firebug+Lite.aspx"&gt;I’ve
praised it before&lt;/a&gt;, but now it’s one key press away in Sitecore shell applications.
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
Press F12 and the firebug lite console will pop up from the top:
&lt;/p&gt;
&lt;p&gt;
&lt;img title="Firebug lite opened in Sitecore Content Editor" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="453" alt="Firebug lite opened in Sitecore Content Editor" src="http://alexeyrusakov.com/sitecoreblog/content/binary/WindowsLiveWriter/JavascriptFriendsofSitecore_8BA7/image_3.png" width="666" border="0"&gt; 
&lt;/p&gt;
&lt;p&gt;
This means you can use console.log and other instrumentation methods to debug your
javascript.
&lt;/p&gt;
&lt;p&gt;
Sitecore UI has a lot of IFrames, so pay attention where you click before opening
the console – each IFrame is a separate javascript realm, and therefore has its own
firebug console.
&lt;/p&gt;
&lt;h3&gt;The Website is Safe
&lt;/h3&gt;
&lt;p&gt;
I’d like to stress again that both Prototype and Firebug lite are only included in
the Sitecore shell applications. Technically, if the sitecore.js javascript file is
loaded, the prototype and firebug are also inlcuded. 
&lt;/p&gt;
&lt;p&gt;
We don’t add anything to the frontend sites – it’s your decision.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://alexeyrusakov.com/sitecoreblog/aggbug.ashx?id=6704bf3d-8980-4f29-9ac2-125cff64bb80" /&gt;</description>
      <comments>http://alexeyrusakov.com/sitecoreblog/CommentView,guid,6704bf3d-8980-4f29-9ac2-125cff64bb80.aspx</comments>
      <category>Sitecore</category>
      <category>Sitecore/Crestone</category>
      <category>Web development</category>
    </item>
    <item>
      <trackback:ping>http://alexeyrusakov.com/sitecoreblog/Trackback.aspx?guid=9d51e4eb-771d-499b-a8e4-da1b43f9e629</trackback:ping>
      <pingback:server>http://alexeyrusakov.com/sitecoreblog/pingback.aspx</pingback:server>
      <pingback:target>http://alexeyrusakov.com/sitecoreblog/PermaLink,guid,9d51e4eb-771d-499b-a8e4-da1b43f9e629.aspx</pingback:target>
      <dc:creator>Alexey Rusakov</dc:creator>
      <wfw:comment>http://alexeyrusakov.com/sitecoreblog/CommentView,guid,9d51e4eb-771d-499b-a8e4-da1b43f9e629.aspx</wfw:comment>
      <wfw:commentRss>http://alexeyrusakov.com/sitecoreblog/SyndicationService.asmx/GetEntryCommentsRss?guid=9d51e4eb-771d-499b-a8e4-da1b43f9e629</wfw:commentRss>
      <slash:comments>4</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
        </p>
        <p>
        </p>
        <p>
And in case you haven’t seen this elsewhere: Do not install the .NET 3.5 Service Pack
1 on any servers running Sitecore. Service pack updates the LosFormatter class which
is responsible for viewstate serialization/deserialization in the ASP.NET, and it
looks like they’ve introduced a subtle bug that hit us.
</p>
        <p>
 
</p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
An official release:
</p>
        <p>
Dear Sitecore Enthusiast, 
</p>
        <p>
You are receiving this message because you are subscribed to the Sitecore Product
Issues and Patches mailing list. 
</p>
        <p>
On Monday, August 4th, Microsoft released the following service packs: Visual Studio
2008 SP1 and .NET 3.5 SP1. 
</p>
        <p>
Sitecore has discovered that these service packs introduce a bug in the LosFormatter
class (System.Web.UI.LosFormatter in System.Web.dll, used to serialize and deserialize
an ASP.NET ViewState). This bug causes stability issues in Sitecore products. Sitecore
has raised this as an urgent priority issue with Microsoft (case number : SRQ080813600454)
and is working to help resolve this issue. 
</p>
        <p>
In the meantime, <strong>PLEASE DO NOT INSTALL .NET 3.5 SP1 and Visual Studio 2008
SP1</strong> on any server running a Sitecore product (including Sitecore WCMS, Intranet
Portal, and Foundry) until further notice! 
</p>
        <p>
Symptoms associated with installing either of these service packs: 
</p>
        <ol>
          <li>
Memory consumption increases dramatically and single core CPU usage goes up to 100%
when opening the Access Viewer or Media Library applications. 
</li>
          <li>
OutOfMemoryExceptions thrown in the Desktop and Content Editor. 
</li>
          <li>
The browser becomes unresponsive when accessing Sitecore. 
</li>
        </ol>
        <p>
Please be aware that Microsoft  may include this Service Pack as part of the
monthly ‘Patch Tuesday’.  Please take steps to avoid the automatic installation
of these service packs. 
</p>
        <p>
Please be aware that the final version of SQL Server 2008 will require .NET 3.5 SP1. 
</p>
        <p>
If you have any questions about this issue, please contact Sitecore support. 
</p>
        <p>
Best Regards, 
<br />
Sitecore Support Team. <img width="0" height="0" src="http://alexeyrusakov.com/sitecoreblog/aggbug.ashx?id=9d51e4eb-771d-499b-a8e4-da1b43f9e629" /></p>
      <xhtml:img xmlns:xhtml="http://www.w3.org/1999/xhtml" src="http://feeds.feedburner.com/~r/alexeyrusakov/sitecore/~4/364579543" height="1" width="1" /></body>
      <title>Don&amp;rsquo;t Install .NET 3.5 Service Pack 1 on Sitecore Servers Yet</title>
      <guid isPermaLink="false">http://alexeyrusakov.com/sitecoreblog/PermaLink,guid,9d51e4eb-771d-499b-a8e4-da1b43f9e629.aspx</guid>
      <link>http://alexeyrusakov.com/sitecoreblog/2008/08/14/Donrsquot+Install+NET+35+Service+Pack+1+On+Sitecore+Servers+Yet.aspx</link>
      <pubDate>Thu, 14 Aug 2008 07:05:40 GMT</pubDate>
      <description>&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
And in case you haven’t seen this elsewhere: Do not install the .NET 3.5 Service Pack
1 on any servers running Sitecore. Service pack updates the LosFormatter class which
is responsible for viewstate serialization/deserialization in the ASP.NET, and it
looks like they’ve introduced a subtle bug that hit us.
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
An official release:
&lt;/p&gt;
&lt;p&gt;
Dear Sitecore Enthusiast, 
&lt;p&gt;
You are receiving this message because you are subscribed to the Sitecore Product
Issues and Patches mailing list. 
&lt;p&gt;
On Monday, August 4th, Microsoft released the following service packs: Visual Studio
2008 SP1 and .NET 3.5 SP1. 
&lt;p&gt;
Sitecore has discovered that these service packs introduce a bug in the LosFormatter
class (System.Web.UI.LosFormatter in System.Web.dll, used to serialize and deserialize
an ASP.NET ViewState). This bug causes stability issues in Sitecore products. Sitecore
has raised this as an urgent priority issue with Microsoft (case number : SRQ080813600454)
and is working to help resolve this issue. 
&lt;p&gt;
In the meantime, &lt;strong&gt;PLEASE DO NOT INSTALL .NET 3.5 SP1 and Visual Studio 2008
SP1&lt;/strong&gt; on any server running a Sitecore product (including Sitecore WCMS, Intranet
Portal, and Foundry) until further notice! 
&lt;p&gt;
Symptoms associated with installing either of these service packs: 
&lt;ol&gt;
&lt;li&gt;
Memory consumption increases dramatically and single core CPU usage goes up to 100%
when opening the Access Viewer or Media Library applications. 
&lt;li&gt;
OutOfMemoryExceptions thrown in the Desktop and Content Editor. 
&lt;li&gt;
The browser becomes unresponsive when accessing Sitecore. 
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
Please be aware that Microsoft&amp;nbsp; may include this Service Pack as part of the
monthly ‘Patch Tuesday’.&amp;nbsp; Please take steps to avoid the automatic installation
of these service packs. 
&lt;p&gt;
Please be aware that the final version of SQL Server 2008 will require .NET 3.5 SP1. 
&lt;p&gt;
If you have any questions about this issue, please contact Sitecore support. 
&lt;p&gt;
Best Regards, 
&lt;br&gt;
Sitecore Support Team. &lt;img width="0" height="0" src="http://alexeyrusakov.com/sitecoreblog/aggbug.ashx?id=9d51e4eb-771d-499b-a8e4-da1b43f9e629" /&gt;</description>
      <comments>http://alexeyrusakov.com/sitecoreblog/CommentView,guid,9d51e4eb-771d-499b-a8e4-da1b43f9e629.aspx</comments>
      <category>ASP.NET</category>
      <category>Sitecore</category>
    </item>
    <item>
      <trackback:ping>http://alexeyrusakov.com/sitecoreblog/Trackback.aspx?guid=9582d4d9-9549-47c8-b162-d13d2cccf4a3</trackback:ping>
      <pingback:server>http://alexeyrusakov.com/sitecoreblog/pingback.aspx</pingback:server>
      <pingback:target>http://alexeyrusakov.com/sitecoreblog/PermaLink,guid,9582d4d9-9549-47c8-b162-d13d2cccf4a3.aspx</pingback:target>
      <dc:creator>Alexey Rusakov</dc:creator>
      <wfw:comment>http://alexeyrusakov.com/sitecoreblog/CommentView,guid,9582d4d9-9549-47c8-b162-d13d2cccf4a3.aspx</wfw:comment>
      <wfw:commentRss>http://alexeyrusakov.com/sitecoreblog/SyndicationService.asmx/GetEntryCommentsRss?guid=9582d4d9-9549-47c8-b162-d13d2cccf4a3</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <img title="Sitecore 6 folder view" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 0px 10px 10px; border-right-width: 0px" height="230" alt="Sitecore 6 folder view" src="http://alexeyrusakov.com/sitecoreblog/content/binary/WindowsLiveWriter/Sitecore6PipelinesrenderItemTile_8807/image_3.png" width="351" align="right" border="0" /> renderItemTitle
is another presentational pipeline introduced in Sitecore 6, allowing to modify the
appearance of item blocks, or tiles, in the folder views. Folder view is what you
see on the right: a default tab on folder items. You can also add it to any other
item by adding it to the Editors list.
</p>
        <p>
Hooking into the renderItemTile allows changing the appearance of individual item
tiles. Most often, however, customization scenarios include adding a few bits of information,
relevant to all items or to specific item types.
</p>
        <p>
This is how the pipeline looks out of the box (simplified):
</p>
        <p>
          <font face="Courier New">&lt;renderItemTile&gt;<br />
  &lt;processor type="RenderFolderTile" /&gt;<br />
  &lt;processor type="RenderTemplateTile" /&gt;<br />
  &lt;processor type="RenderDefaultTile" /&gt;<br />
&lt;/renderItemTile&gt;</font>
        </p>
        <p>
        </p>
        <p>
The RenderFolderTile and RenderTemplateTile add information relevant to folders (a
number of subitems) or templates (a number of usages).
</p>
        <p>
In this example, I’ll be adding information about a number of validation errors of
the item.
</p>
        <p>
The processor has to inherit from Sitecore.Pipelines.RenderItemTile.RenderTileBase.
This base class is already capable of rendering a default item tile, so I’m just slightly
changing its behavior to also output a number of validation errors.
</p>
        <pre>public class RenderItemTile : RenderTileBase {
  public override void Process(RenderItemTileArgs args) {
    if (args.View != TileView.Tiles) {
      return;
    }

    base.Process(args);

    args.AbortPipeline();
  }

  protected override void RenderTileDetails(HtmlTextWriter output, RenderItemTileArgs args) {
    base.RenderTileDetails(output, args);

    var errorCount = GetErrorCount(args.Item);
    if (errorCount == 0) {
      return;
    }

    var message = errorCount &gt; 1 ? "{0} errors".FormatWith(errorCount) : "1 error";
    output.Write("&lt;div class="\"scTileItemDetailsLine\"" style="color: red"&gt;");
    output.Write(message);
    output.Write("&lt;/div&gt;");
  }

  int GetErrorCount(Item item) {
    var errorCount = 0;

    var validators = ValidatorManager.BuildValidators(ValidatorsMode.Gutter, item);
    ValidatorManager.Validate(validators, new ValidatorOptions(false));

    foreach(BaseValidator validator in validators) {
      if (validator.Result &gt;= ValidatorResult.Warning) {
        errorCount++;
      }
    }

    return errorCount;
  }
}
</pre>
        <p>
A few pieces to notice:
</p>
        <ol>
          <li>
args.View defines the mode the pipeline runs in: Tiles, Large Icons, Small Icons,
etc. Most of those are reserved for the future use and at the moment Sitecore only
uses Tiles or IconOnly modes. In this customization, we’re after the Tiles mode.<br /></li>
          <li>
A relatively simple RenderTileDetails method is overriden. This method is only responsible
only for the information to the right of the icon. The general shape and style of
the tile, as well as the icon, are handled by other more complicated methods, which
we’re not interested in.<br /></li>
          <li>
Note the usage of the new Validation API to validate the item: GetErrorCount method.
Here I’m validating the item in the ‘Gutter’ (which is the old name for Quick Action
Bar) mode. This means that the folder view will only run validators configured for
the quick action bar (see the validation documentation on SDN and my <a href="http://alexeyrusakov.com/sitecoreblog/2008/07/02/Sitecore+6+Validation+Part+1.aspx">post
on validation</a> for more)<br /></li>
          <li>
Once the tile is rendered, the pipeline must be aborted, or the RenderDefaultTile
processor will kick in and do it’s job.</li>
        </ol>
        <p>
 
</p>
        <p>
As with other pipelines, Sitecore only knows about generic data concepts such as templates,
folders and items. We cannot provide the customizations specific to the business domain
of each site, but you can. The renderItemTile pipeline can be used to add information
that describes each specific item type best: a publication date of the news item,
a number of comments of the blog post or a discount percentage for a sales partner.
And because it’s a pipeline, you can even display different information to different
types of users.
</p>
        <img width="0" height="0" src="http://alexeyrusakov.com/sitecoreblog/aggbug.ashx?id=9582d4d9-9549-47c8-b162-d13d2cccf4a3" />
      <xhtml:img xmlns:xhtml="http://www.w3.org/1999/xhtml" src="http://feeds.feedburner.com/~r/alexeyrusakov/sitecore/~4/364579544" height="1" width="1" /></body>
      <title>Sitecore 6 Pipelines: renderItemTile</title>
      <guid isPermaLink="false">http://alexeyrusakov.com/sitecoreblog/PermaLink,guid,9582d4d9-9549-47c8-b162-d13d2cccf4a3.aspx</guid>
      <link>http://alexeyrusakov.com/sitecoreblog/2008/08/14/Sitecore+6+Pipelines+RenderItemTile.aspx</link>
      <pubDate>Thu, 14 Aug 2008 06:57:47 GMT</pubDate>
      <description>&lt;p&gt;
&lt;img title="Sitecore 6 folder view" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 0px 10px 10px; border-right-width: 0px" height="230" alt="Sitecore 6 folder view" src="http://alexeyrusakov.com/sitecoreblog/content/binary/WindowsLiveWriter/Sitecore6PipelinesrenderItemTile_8807/image_3.png" width="351" align="right" border="0"&gt; renderItemTitle
is another presentational pipeline introduced in Sitecore 6, allowing to modify the
appearance of item blocks, or tiles, in the folder views. Folder view is what you
see on the right: a default tab on folder items. You can also add it to any other
item by adding it to the Editors list.
&lt;/p&gt;
&lt;p&gt;
Hooking into the renderItemTile allows changing the appearance of individual item
tiles. Most often, however, customization scenarios include adding a few bits of information,
relevant to all items or to specific item types.
&lt;/p&gt;
&lt;p&gt;
This is how the pipeline looks out of the box (simplified):
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New"&gt;&amp;lt;renderItemTile&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;processor type="RenderFolderTile" /&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;processor type="RenderTemplateTile" /&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;processor type="RenderDefaultTile" /&amp;gt;&lt;br&gt;
&amp;lt;/renderItemTile&amp;gt;&lt;/font&gt; 
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
The RenderFolderTile and RenderTemplateTile add information relevant to folders (a
number of subitems) or templates (a number of usages).
&lt;/p&gt;
&lt;p&gt;
In this example, I’ll be adding information about a number of validation errors of
the item.
&lt;/p&gt;
&lt;p&gt;
The processor has to inherit from Sitecore.Pipelines.RenderItemTile.RenderTileBase.
This base class is already capable of rendering a default item tile, so I’m just slightly
changing its behavior to also output a number of validation errors.
&lt;/p&gt;
&lt;pre&gt;public class RenderItemTile : RenderTileBase {
  public override void Process(RenderItemTileArgs args) {
    if (args.View != TileView.Tiles) {
      return;
    }

    base.Process(args);

    args.AbortPipeline();
  }

  protected override void RenderTileDetails(HtmlTextWriter output, RenderItemTileArgs args) {
    base.RenderTileDetails(output, args);

    var errorCount = GetErrorCount(args.Item);
    if (errorCount == 0) {
      return;
    }

    var message = errorCount &amp;gt; 1 ? "{0} errors".FormatWith(errorCount) : "1 error";
    output.Write("&amp;lt;div class="\"scTileItemDetailsLine\"" style="color: red"&amp;gt;");
    output.Write(message);
    output.Write("&amp;lt;/div&amp;gt;");
  }

  int GetErrorCount(Item item) {
    var errorCount = 0;

    var validators = ValidatorManager.BuildValidators(ValidatorsMode.Gutter, item);
    ValidatorManager.Validate(validators, new ValidatorOptions(false));

    foreach(BaseValidator validator in validators) {
      if (validator.Result &amp;gt;= ValidatorResult.Warning) {
        errorCount++;
      }
    }

    return errorCount;
  }
}
&lt;/pre&gt;
&lt;p&gt;
A few pieces to notice:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
args.View defines the mode the pipeline runs in: Tiles, Large Icons, Small Icons,
etc. Most of those are reserved for the future use and at the moment Sitecore only
uses Tiles or IconOnly modes. In this customization, we’re after the Tiles mode.&lt;br&gt;
&lt;/li&gt;
&lt;li&gt;
A relatively simple RenderTileDetails method is overriden. This method is only responsible
only for the information to the right of the icon. The general shape and style of
the tile, as well as the icon, are handled by other more complicated methods, which
we’re not interested in.&lt;br&gt;
&lt;/li&gt;
&lt;li&gt;
Note the usage of the new Validation API to validate the item: GetErrorCount method.
Here I’m validating the item in the ‘Gutter’ (which is the old name for Quick Action
Bar) mode. This means that the folder view will only run validators configured for
the quick action bar (see the validation documentation on SDN and my &lt;a href="http://alexeyrusakov.com/sitecoreblog/2008/07/02/Sitecore+6+Validation+Part+1.aspx"&gt;post
on validation&lt;/a&gt; for more)&lt;br&gt;
&lt;/li&gt;
&lt;li&gt;
Once the tile is rendered, the pipeline must be aborted, or the RenderDefaultTile
processor will kick in and do it’s job.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
As with other pipelines, Sitecore only knows about generic data concepts such as templates,
folders and items. We cannot provide the customizations specific to the business domain
of each site, but you can. The renderItemTile pipeline can be used to add information
that describes each specific item type best: a publication date of the news item,
a number of comments of the blog post or a discount percentage for a sales partner.
And because it’s a pipeline, you can even display different information to different
types of users.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://alexeyrusakov.com/sitecoreblog/aggbug.ashx?id=9582d4d9-9549-47c8-b162-d13d2cccf4a3" /&gt;</description>
      <comments>http://alexeyrusakov.com/sitecoreblog/CommentView,guid,9582d4d9-9549-47c8-b162-d13d2cccf4a3.aspx</comments>
      <category>Sitecore</category>
      <category>Sitecore/Crestone</category>
    </item>
  </channel>
</rss>
