<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Richard's Blog &#187; Sitecore</title>
	<atom:link href="http://richdias.wordpress.com/category/sitecore/feed/" rel="self" type="application/rss+xml" />
	<link>http://richdias.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Thu, 23 Apr 2009 10:07:51 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='richdias.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/c7803d15cc8b512478fc7f27b134125f?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Richard's Blog &#187; Sitecore</title>
		<link>http://richdias.wordpress.com</link>
	</image>
			<item>
		<title>Setting up a Sitecore project works with both versions 5.3 and 6</title>
		<link>http://richdias.wordpress.com/2008/10/06/setting-up-a-sitecore-project-works-with-both-versions-53-and-6/</link>
		<comments>http://richdias.wordpress.com/2008/10/06/setting-up-a-sitecore-project-works-with-both-versions-53-and-6/#comments</comments>
		<pubDate>Mon, 06 Oct 2008 01:31:29 +0000</pubDate>
		<dc:creator>richdias</dc:creator>
				<category><![CDATA[Sitecore]]></category>
		<category><![CDATA[Sitecore v6]]></category>
		<category><![CDATA[Visual Studio 2005]]></category>
		<category><![CDATA[Visual Studio 2008]]></category>
		<category><![CDATA[Sitecore project structure]]></category>

		<guid isPermaLink="false">http://richdias.wordpress.com/?p=24</guid>
		<description><![CDATA[Sitecore(SC) has a decent article on how to set up a Sitecore project on Visual Studio. This is a pretty good start but it does not quite meet our company&#8217;s requirements.
In this blog post I will attempt to tell you exactly how a structure a project assuming that you have the following requirements for your [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=richdias.wordpress.com&blog=2729043&post=24&subd=richdias&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Sitecore(SC) has a decent article on how to set up a Sitecore project on Visual Studio. This is a pretty good start but it does not quite meet our company&#8217;s requirements.</p>
<p>In this blog post I will attempt to tell you exactly how a structure a project assuming that you have the following requirements for your SC environment:</p>
<ul>
<li>You need to have multiple websites running on one instance of SC and you want each website to have its own Visual Studio project.</li>
<li>You are not using a virtual folder per website.</li>
<li>You want to manage multiple Class Library/Child projects within each website project.</li>
<li>You want to keep the Renderings, Sub-layouts, Layouts, Associated files (css, js etc) and DLL&#8217;s of each website independent.</li>
</ul>
<p>Our company has worked with multiple projects in Sitecore v5.3 and we have also Started a new project using Sitecore v6 (Visual Studio 2005 and 2008). I can safely say that we have come up with a tried and proven project structure that I can recommend that everyone can and should use. Please follow the SC developer cookbook if you are only going to ever have one website running on your instance of SC.</p>
<p><em>There is a fair bit to write on this entry and I will be slowly updating it, if anyone is in desperate need to this information right now then please leave a comment and I will try to speed things up!</em></p>
<p><span id="more-24"></span></p>
<p><strong>HTML File Structure</strong></p>
<p>It is always good to have a well structured website. Our team deals with the integration of HTML front end with SC. For this reason we usually get out HTML, CSS and JS delivered to us from a 3&#8242;rd party vendor. We get them to deliver the HTML to us in the following structure so that it fits snugly in with our intended .NET project structure:</p>
<p style="text-align:left;"><a href="http://richdias.files.wordpress.com/2008/10/html-project-structure.gif"><img class="size-large wp-image-33 aligncenter" title="html structure" src="http://richdias.files.wordpress.com/2008/10/html-project-structure.gif?w=450&#038;h=319" alt="" width="450" height="319" /></a></p>
<p>Our website will be called &#8220;<em><strong>destinations</strong></em>&#8220;. Our main HTML files are on the highest level and we have folder named &#8216;destinations&#8217; which contains all the css, images, JS etc. (the HTML will reference these files like this &lt;img src=&#8221;/destinations/img/image1.jpg&#8221;/&gt; )</p>
<p style="text-align:left;">Obviously the HTML is just your reference, we will be splitting up all the HTML into Layouts, Sublayouts and Renderings. Only the &#8216;destinations&#8217; folder and its contents will actually be part of our Visual Studio project.</p>
<p style="text-align:left;">Had a Discussion with Elliot who posted comment on this topic. I have pasted the discussion we have had below (<strong>read from bottom up</strong>):</p>
<p style="text-align:left;">
<p style="text-align:left;">HI Eliot,</p>
<p>Sounds like a good approach, we did think of doing it the way you did but we decided not to go ahead with is simply because the Cookbook suggests that all websites are created and run via the website folder.</p>
<p>Even when you do my method, you should only be having the newly created web app in your VS project. You should not need to import any sitecore objects (it should effectively have been the same as your independent virtual directory arrangement). I.e. as mentioned, each website does have its own web.app even tho they have all been moved into the sitecore/websites folder.</p>
<p>I am assuming sitecore&#8217;s web.config will be the failover web.config is your local web.app does not contain any web.config entries that have been tweaked for that site?</p>
<p>Are your URL&#8217;s looking consistent when viewing a web page in preview mode now that you have created the Virtual Folders?<br />
I can&#8217;t really think of any potential issues with your configuration at the moment and if you do manage to avoid any problems this may well be the best soloution structure yet.</p>
<p>Keep me informed.<br />
Thanks,<br />
<span style="color:#888888;">Richard</span></p>
<p>On Fri, Jan 16, 2009 at 5:12 AM, Elliot Ritchie wrote:<br />
Hi Richard</p>
<p>After experimenting with a ton of different configurations I think I&#8217;ve found the ideal way to integrate Sitecore with the current processes and project structures I&#8217;m working with right now; you&#8217;re directions definately provided a leap in the right direction!</p>
<p>Essentially,</p>
<ul>
<li>Each website sits within its own web application that contains all the necessary css, images, renderings and layouts etc for the specific website.</li>
<li>The web applications then reference the Sitecore assemblies from a single predetermined Sitecore installation directory (this also allows for a much more efficient use of source control systems as it means each version controlled website doesn&#8217;t have to also include 300mb+ worth of Sitecore modules).</li>
<li>The web applications&#8217; Web.config contain the necessary Sitecore configuation sections, tweaked for the specific website.</li>
<li>In IIS each web application is setup as its own website, with a virtual directory setup in each to provide the reference to the &#8216;/sitecore/&#8217; directory, again this virtual directory points to the same predetermined Sitecore installation directory as before.</li>
</ul>
<p>If you can see any holes in this setup please let me know, or any thoughts in general, but so far everything is running great!</p>
<p>Many Thanks</p>
<div>
<p>Elliot</p>
<hr />Date: Wed, 14 Jan 2009 10:15:07 +0530<br />
Subject: Sitecore Project structure<br />
From: Me<br />
To: Elliot</div>
<p>Hi Elliot,</p>
<p>I can&#8217;t really update my Blog at the moment because I am on holiday ( I will be working purely off memory). I have been pretty lazy with that I must admit.<br />
Will try to outline the steps here (I will assume your project is called <em>destinations</em> following from my HTML structure blog post:</p>
<ol>
<li>You will need to follow the Sitecore developer cook book and create a project as described there (name the project DestinationsApp for consistency) within the sitecore/websites folder.</li>
<li>Given that you will be working with multiple projects (websites) then you will need to have more than one &#8216;properties&#8217; folder (one is needed for each project solution) so you will need to rename the Properties folder to something like DestinationsProperties.Once you have done this you will need to edit the DestinationsApp project (.csj I think) file with a text editor and replace all instances of the &#8216;properties&#8217; folder name to match your new &#8216;DestinationsProperties&#8217; folder name. Close this file and you are ready to open the project &#8211; go ahead and add a reference to Sitecore.Kernal.dll and dont forget to set copyLocal to <em>false</em>.</li>
<li>Now that you have a basic Web App project there you can start adding the extra sections to this project. Create a folder within sitecore/website named &#8216;destinations&#8217;. Include this newly created folder in your DestinationsApp project because this will contain all the misc web files. Copy all the files from your HTML/destinations folder into the sitecore/website/destinations folder.</li>
<li>Within the sitecore/websites/layouts folder create a folder called &#8216;destinations&#8217;. Include this folder in the DestinationsApp project. All your <strong>layouts </strong>and <strong>sublayouts </strong>for the destinations website should be created here within the sitecore/websites/layouts/destinations folder. You can reference your css files and image files (that will be in the folder created at step 3) from all layouts and renderings by refering to the src/link like this: &lt;img src=\destinations\img\image1.jpg /&gt;</li>
<li>Within the sitecore/websites/xsl folder create a folder called &#8216;destinations&#8217;. Include this folder in the DestinationsApp project. All your <strong>renderings </strong>for the destinations website should be created here within the sitecore/websites/xsl/destinations folder.</li>
<li>Now you should be ready to go with the creation of a basic website. I suggest that in your Content tree you start off your content within sitecore/content/destinations/home where Home will be your home page. When you have a second website to go in your sitecore instance then that can be located within sitecore/content/secondwebsite/home in the content tree. You will ofcourse need to change the web.config &lt;sites&gt; section to add each website.</li>
<li>We often have accompanying DLL class libraries (e.d. a DestinationsLogic class library project) and also a Database project when integrating 3&#8242;rd party DB&#8217;s with your sitecore website. I highly reccomend that you create and store these projects outside of your &#8217;sitecore/website&#8217; folder because the goal is to keep the sitecore/website folder a clutter-free as possible. Create a filder within the C drive called c:/DestinationsProjects and then create two seperate folders in here for DestinationsLogic and DestinationsDB. Add your extra projects in here and by all means create these projects by &#8216;adding new project&#8217; to your DestinationsApp project solution. This way all your projects will be logically in the same Visual Studio solution but Physically seperate. Add a Reference to each of these projects in your DestinationsApp project (and leave copyLocal as <em>true</em>) so that each time you compile your solution a <strong>DestinationsLogic.dll</strong> will be created in the sitecore/website/bin folder.</li>
<li>When you have this structure set up, you can easily add more websites to your sitecore instance by following steps 1 to 8 for each new websites and just replacing the word &#8216;Destinations&#8217; with the name of your new website and they will all co-exsist without problems and you will end up with a highly maintainable, clutter-free project/site structure.</li>
</ol>
<p>Hope this helps,<br />
Richard</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/richdias.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/richdias.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/richdias.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/richdias.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/richdias.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/richdias.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/richdias.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/richdias.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/richdias.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/richdias.wordpress.com/24/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=richdias.wordpress.com&blog=2729043&post=24&subd=richdias&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://richdias.wordpress.com/2008/10/06/setting-up-a-sitecore-project-works-with-both-versions-53-and-6/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cd1d07890856310e1e046adedc07ad7b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">richdias</media:title>
		</media:content>

		<media:content url="http://richdias.files.wordpress.com/2008/10/html-project-structure.gif?w=450" medium="image">
			<media:title type="html">html structure</media:title>
		</media:content>
	</item>
		<item>
		<title>ASP.NET service faulting error Sitecore 6 workaround</title>
		<link>http://richdias.wordpress.com/2008/10/05/aspnet-service-faulting-error-sitecore-6-workaround/</link>
		<comments>http://richdias.wordpress.com/2008/10/05/aspnet-service-faulting-error-sitecore-6-workaround/#comments</comments>
		<pubDate>Sun, 05 Oct 2008 22:57:21 +0000</pubDate>
		<dc:creator>richdias</dc:creator>
				<category><![CDATA[Sitecore]]></category>
		<category><![CDATA[Sitecore 6]]></category>

		<guid isPermaLink="false">http://richdias.wordpress.com/?p=21</guid>
		<description><![CDATA[We have sitecore 6 environments working on Virtual Machines (VM&#8217;s). Sitecore 6 seems to cause an ASP error at seemingly random intervals leading to a total loss of service 9only on VM&#8217;s. Event Viewer will show you the following error:
Event Type: Error
Event Source: Application Error
Event Category: (100)
Event ID: 1000
Date:  8/8/2008
Time:  4:09:35 PM
User:  N/A
Computer: SCTEST
Description:
Faulting application w3wp.exe, version 6.0.3790.3959, faulting module unknown, version 0.0.0.0, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=richdias.wordpress.com&blog=2729043&post=21&subd=richdias&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>We have sitecore 6 environments working on Virtual Machines (VM&#8217;s). Sitecore 6 seems to cause an ASP error at seemingly random intervals leading to a total loss of service 9only on VM&#8217;s. Event Viewer will show you the following error:</p>
<p><span style="font-family:Courier New;font-size:x-small;"><strong>Event Type: Error<br />
Event Source: Application Error<br />
Event Category: (100)<br />
Event ID: 1000<br />
Date:  8/8/2008<br />
Time:  4:09:35 PM<br />
User:  N/A<br />
Computer: SCTEST<br />
Description:<br />
Faulting application w3wp.exe, version 6.0.3790.3959, faulting module unknown, version 0.0.0.0, fault address 0&#215;709a2075.</strong></span></p>
<p>Sitecore have provided a work-around for this. Set the following web.config entry to &#8216;false&#8217; as show below:</p>
<p>&lt;!&#8211;  ENABLE COUNTERS<br />
Indicates if performance counters are enabled.<br />
Default value: true<br />
&#8211;&gt;<br />
&lt;setting name=&#8221;Counters.Enabled&#8221; value=&#8221;false&#8221; /&gt;</p>
<p>We have made this change and it seems to get rid of the issue. Seems like Sitecores backend performance monitoring may be using some .NET 3.5 functionality that causes this error (this is just a guess).</p>
<p>See the SC forum for more details:</p>
<p>http://sdn5.sitecore.net/forum/ShowPost.aspx?PostID=11838#11838</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/richdias.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/richdias.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/richdias.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/richdias.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/richdias.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/richdias.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/richdias.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/richdias.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/richdias.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/richdias.wordpress.com/21/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=richdias.wordpress.com&blog=2729043&post=21&subd=richdias&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://richdias.wordpress.com/2008/10/05/aspnet-service-faulting-error-sitecore-6-workaround/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cd1d07890856310e1e046adedc07ad7b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">richdias</media:title>
		</media:content>
	</item>
		<item>
		<title>Sitecore &#8211; Store Multilist related content within local item on save</title>
		<link>http://richdias.wordpress.com/2008/02/05/sitecore-store-multilist-related-content-within-local-item-on-save/</link>
		<comments>http://richdias.wordpress.com/2008/02/05/sitecore-store-multilist-related-content-within-local-item-on-save/#comments</comments>
		<pubDate>Tue, 05 Feb 2008 00:50:18 +0000</pubDate>
		<dc:creator>richdias</dc:creator>
				<category><![CDATA[Sitecore]]></category>
		<category><![CDATA[multilist]]></category>
		<category><![CDATA[on save]]></category>

		<guid isPermaLink="false">http://richdias.wordpress.com/?p=8</guid>
		<description><![CDATA[The Requirement
Our clients have &#8217;subject&#8217; and &#8217;function&#8217; Metadata fields within their web page. They wanted to be able to content manage this subject and function list . They then wanted to be able to assign a subset of these function and subject keywords into each web page item (so all the subjects and functions are common [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=richdias.wordpress.com&blog=2729043&post=8&subd=richdias&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><strong>The Requirement</strong></p>
<p>Our clients have &#8217;subject&#8217; and &#8217;function&#8217; Metadata fields within their web page. They wanted to be able to content manage this subject and function list . They then wanted to be able to assign a subset of these function and subject keywords into each web page item (so all the subjects and functions are common to the whole site).</p>
<p><strong>The Problem</strong></p>
<p>The cleanest solution to this problem was to define a bunch of simple text items for each of the subjects and functions within specfic folder items. We would then create two multi lists in the Metadata base template (one for subject and one for function) and point them at these respective source directories.</p>
<p>Now think of the situation:  We have 5 subjects and 3 functions on average per web page. In the background, we are going to have to pull out data from 8 related content items every time we load a given page. We did not want to do this so we devised a simple work-around that would let us retain the useability of the method discussed above but also ave all this related content available on the one item when it needs to be served up.</p>
<p><strong>The Solution</strong> (I will be using a simple &#8216;Category&#8217; multilist example as a demo here)</p>
<p>We added two hidden (not visible to author) text field within the Metadata base template to correspond with each multilist. These two text fields will contain the content (not the Id&#8217;s) of the &#8216;Description&#8217; field of the referenced items seperating each with a &#8216;|&#8217; delimeter as can be seen below.<br />
<a href="http://richdias.files.wordpress.com/2008/02/multilistcontentfieldshiddenfield.jpg" title="multilistcontentfieldshiddenfield.jpg"></a></p>
<p> <a target="_blank" href="http://richdias.files.wordpress.com/2008/02/multilistcontentfieldshiddenfield.jpg"><img src="http://richdias.files.wordpress.com/2008/02/multilistcontentfieldshiddenfield.thumbnail.jpg" alt="multilistcontentfieldshiddenfield.jpg" /></a></p>
<p> The categories associate to a simple text field item which <strong>must </strong>have a field named &#8216;Description&#8217; within it:</p>
<p> <a target="_blank" href="http://richdias.files.wordpress.com/2008/02/categoriesitem-template.jpg"><img src="http://richdias.files.wordpress.com/2008/02/categoriesitem-template.thumbnail.jpg" alt="categoriesitem-template.jpg" /></a></p>
<p>All the categories should lie within a common folder item so that we can point our multilist source at that folder:</p>
<p><a target="_blank" href="http://richdias.files.wordpress.com/2008/02/categoriescontenttree.jpg"><img src="http://richdias.files.wordpress.com/2008/02/categoriescontenttree.thumbnail.jpg" alt="categoriescontenttree.jpg" /></a></p>
<p>In the template that holds the multilist, make sure that you create a text field with the name &#8216;chosen &#8216; + &lt;multilist name&gt;. I.e. in our example, our multilist is named &#8216;Categories&#8217;, so our hidden text field will be called &#8216;Chosen Categories&#8217;</p>
<p> <a target="_blank" href="http://richdias.files.wordpress.com/2008/02/multilistreferencetemplate.jpg"><img src="http://richdias.files.wordpress.com/2008/02/multilistreferencetemplate.thumbnail.jpg" alt="multilistreferencetemplate.jpg" /></a><a href="http://richdias.files.wordpress.com/2008/02/multilistreferencetemplate.jpg" title="multilistreferencetemplate.jpg"></a></p>
<p>Now we create an OnSaving event which does the following:</p>
<p>1. Check if the item thats being saved contains any multilists</p>
<p> 2. If 1 = true, then for each multilist named &lt;name&gt; in the current item</p>
<p>3. Check if there is a field named &#8216;Chosen &#8216; + &lt;name&gt; (of the current multilist) from 2</p>
<p>4. If 3 = true, then clear the &#8216;Chosen &#8216; + &lt;name&gt; field of its content; retrieve all the items referenced by the current multilist; For each of these items check if a &#8216;Description&#8217; field exists; if &#8216;Description&#8217; exists and there is content within it, add this content to &#8216;Chosen &#8216; + &lt;name&gt;</p>
<p>I have pasted the code for the <em>ItemOnSavingEvents.cs</em> class here (sorry about the indentation, copy/paste into blog isnt the best):</p>
<p><font size="2">using System;<br />
using System.Data;<br />
using System.Configuration;<br />
using System.Web;<br />
using System.Web.Security;<br />
using System.Web.UI;<br />
using System.Web.UI.WebControls;<br />
using System.Web.UI.WebControls.WebParts;<br />
using System.Web.UI.HtmlControls;<br />
using Sitecore;<br />
using Sitecore.Data.Events;<br />
using Sitecore.Data;<br />
using System.Collections;   </font></p>
<p><font size="2">namespace SitecoreSCD1Labs<br />
{<br />
    public class ItemOnSavingEvents<br />
    {<br />
        public void OnItemSavingPopulateHidenFields(object sender, EventArgs args)<br />
        {<br />
            Sitecore.Data.Items.Item item = Sitecore.Events.Event.ExtractParameter(args, 0) as Sitecore.Data.Items.Item;<br />
           <br />
            Sitecore.Collections.FieldCollection fields = item.Fields;</font></p>
<p><font size="2">            foreach( Sitecore.Data.Fields.Field field in fields ) {<br />
                if (field.Type == &#8220;multilist&#8221;)<br />
                {<br />
                    Sitecore.Data.Fields.MultilistField mlf = (Sitecore.Data.Fields.MultilistField)field;<br />
                    String fieldname = field.Name;</font></p>
<p><font size="2">                    if( item.Fields["chosen " + fieldname] != null ) { //Hidden field for corresponding multilist exists<br />
                        Sitecore.Data.Fields.Field hiddenField = item.Fields["chosen " + fieldname];<br />
                        hiddenField.SetValue(&#8220;&#8221;, false);</font></p>
<p><font size="2"><br />
                        //Populate the hidden field with the descriptions from the related items (pipe delimitered)<br />
                        String[] relatedItemGuids = mlf.Items;<br />
                         <br />
                        foreach (String guid in relatedItemGuids)<br />
                        {<br />
                            Sitecore.Data.Database currentDB = Sitecore.Configuration.Factory.GetDatabase(&#8220;master&#8221;);<br />
                            Sitecore.Data.Items.Item relatedItem = currentDB.Items.GetItem(guid);</font><font size="2">                            if (relatedItem != null)<br />
                            {<br />
                                if (relatedItem.Fields["description"] != null)<br />
                                    if (hiddenField.ToString() == &#8220;&#8221;)<br />
                                        hiddenField.SetValue(relatedItem.Fields["description"].ToString(), false);<br />
                                    else<br />
                                        hiddenField.SetValue(hiddenField.ToString() + &#8220;|&#8221; + relatedItem.Fields["description"].ToString(), false);</font><font size="2">                            }<br />
                        }      <br />
                    }<br />
                }<br />
            }<br />
        }<br />
    }<br />
}<br />
</font><font size="2"></font><font size="2"> Add a web.config entry in the Item onsave event to run your code:</font><font size="2">&lt;event name=&#8221;item:saving&#8221;&gt;<br />
   &lt;handler type=&#8221;SitecoreSCD1Labs.ItemOnSavingEvents, SitecoreSCD1Labs&#8221; method=&#8221;OnItemSavingPopulateHidenFields&#8221; /&gt;<br />
  &lt;/event&gt;</font><font size="2"><strong>Drawbacks of this solution</strong></font><font size="2">Unfortunately if the content author changes an existing subject or function then the current items will not automatically change to reflect the new update. The new change will only get reflected on existing items once those items get <em>edited</em> for any reason and re-saved (I have found that some edit needs to be made, i.e. even a smal re-sort of one of the metadata multilist fields, otherwise the item:onsave event does not fire even if save is clicked). In our case the user will most likely only add new subjects and functions and not change existing ones.</p>
<p></font></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/richdias.wordpress.com/8/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/richdias.wordpress.com/8/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/richdias.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/richdias.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/richdias.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/richdias.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/richdias.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/richdias.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/richdias.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/richdias.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/richdias.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/richdias.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=richdias.wordpress.com&blog=2729043&post=8&subd=richdias&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://richdias.wordpress.com/2008/02/05/sitecore-store-multilist-related-content-within-local-item-on-save/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cd1d07890856310e1e046adedc07ad7b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">richdias</media:title>
		</media:content>

		<media:content url="http://richdias.files.wordpress.com/2008/02/multilistcontentfieldshiddenfield.thumbnail.jpg" medium="image">
			<media:title type="html">multilistcontentfieldshiddenfield.jpg</media:title>
		</media:content>

		<media:content url="http://richdias.files.wordpress.com/2008/02/categoriesitem-template.thumbnail.jpg" medium="image">
			<media:title type="html">categoriesitem-template.jpg</media:title>
		</media:content>

		<media:content url="http://richdias.files.wordpress.com/2008/02/categoriescontenttree.thumbnail.jpg" medium="image">
			<media:title type="html">categoriescontenttree.jpg</media:title>
		</media:content>

		<media:content url="http://richdias.files.wordpress.com/2008/02/multilistreferencetemplate.thumbnail.jpg" medium="image">
			<media:title type="html">multilistreferencetemplate.jpg</media:title>
		</media:content>
	</item>
		<item>
		<title>Sitecore &#8211; Custom Text Field</title>
		<link>http://richdias.wordpress.com/2008/02/03/hello-world/</link>
		<comments>http://richdias.wordpress.com/2008/02/03/hello-world/#comments</comments>
		<pubDate>Sun, 03 Feb 2008 23:06:11 +0000</pubDate>
		<dc:creator>richdias</dc:creator>
				<category><![CDATA[Sitecore]]></category>
		<category><![CDATA[Custom field type]]></category>
		<category><![CDATA[Custom Text Field]]></category>
		<category><![CDATA[Field Type]]></category>
		<category><![CDATA[MacroText.cs]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[
In this blog I will describe how to create a very simple Custom Text field in Sitecore. I have based this off the example of a custom checkbox field that can be found in the Sitecore website from here.
I have found that this example is far too complicated. I tried to create a Custom control [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=richdias.wordpress.com&blog=2729043&post=1&subd=richdias&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><ins datetime="2008-02-04T00:36:45+00:00"></ins><br />
In this blog I will describe how to create a very simple Custom Text field in Sitecore. I have based this off the example of a custom checkbox field that can be found in the Sitecore website from <a href="http://sdn5.sitecore.net/articles/api/creating%20a%20composite%20custom%20field.aspx" title="Custom Checkbox - Sitecore. " target="_blank">here</a>.</p>
<p>I have found that this example is far too complicated. I tried to create a Custom control by inheriting <code>Sitecore.Web.UI.HtmlControls.Control</code> but I could not get it working properly initially (I find the Custom check box control that Sitecore has used as an example is far too complicated)  I was sent a better example by sitecore and I will make the same custom control by inheriting this class in the near future when I find the time. However, because of current time constraints I had to take an alternative approach.</p>
<p>The control I have made is inheriting <code>Sitecore.Shell.Applications.ContentEditor.Text</code> directly and then overriding the HandleMessage event.</p>
<p>I needed to create a Custom Text field which behaves the same way as Sitecore&#8217;s Text field but I needed some extra menu items. Basically I needed to allow my authors to add some extra text Macron characters e.g. <b>Ā</b></p>
<p>Here is the Sitecore Field Type item I have created (this should be implemented following the Sitecore <a href="http://sdn5.sitecore.net/articles/api/creating%20a%20composite%20custom%20field.aspx" title="Sitecore custom check box. " target="_blank">example</a>) Base Template is Sitecore&gt;Templates&gt;System&gt;Templates&gt;Template Field Type:<br />
<a href="http://richdias.files.wordpress.com/2008/02/macrontext-item.jpg" title="MacroText item"><img src="http://richdias.files.wordpress.com/2008/02/macrontext-item.jpg" alt="MacroText item" /></a></p>
<p>This is the Macron menu item I will be using as an example:<br />
<a href="http://richdias.files.wordpress.com/2008/02/macrontext-menu-item.jpg" title="Macron text menu item."><img src="http://richdias.files.wordpress.com/2008/02/macrontext-menu-item.jpg" alt="Macron text menu item." /></a></p>
<p>This is the end result I am trying to achieve (A regular text box with extra drop down menu items in Authoring mode):<br />
<a href="http://richdias.files.wordpress.com/2008/02/macrontext-field.jpg" title="Field."><img src="http://richdias.files.wordpress.com/2008/02/macrontext-field.jpg" alt="Field." /></a></p>
<p>Here is the Code <b>MacroText.cs</b>. As you may notice only the Clear field and the actual macron menu functions are currently working:<br />
Note: I also had to chuck a space where it says &#8216;&amp; #256;&#8217; between the &amp; and the #256; because otherwise this blog seems to keep converting it to &#8220;Ā&#8217; within the code!!</p>
<p>I have uploaded this code to another blog that actually retains the indentation <a href="http://richdman.spaces.live.com/blog/cns!AF561F88F8A43CB9!125.entry" title="code. " target="_blank">here</a></p>
<p>using System;<br />
using System.Collections.Generic;<br />
using System.Text;<br />
using System.Data;<br />
using System.Xml;<br />
using System.Web.UI;</p>
<p>namespace Datacom.FieldTypeExtensions<br />
{<br />
    class MacroText : Sitecore.Shell.Applications.ContentEditor.Text<br />
    {     </p>
<p>        #region Constructor<br />
        public MacroText()<br />
        {<br />
            this.Class = &#8220;scContentControl&#8221;;<br />
            base.Activation = true;<br />
        }<br />
        #endregion        </p>
<p>        #region Overrides</p>
<p>        public override void HandleMessage(Sitecore.Web.UI.Sheer.Message message)<br />
        {</p>
<p>            if (message["id"] == this.ID)<br />
            {<br />
                string messageText;<br />
                if ((messageText = message.Name) == null)<br />
                {<br />
                    return;<br />
                }</p>
<p>                switch (messageText)<br />
                {<br />
                    case &#8220;macrotext:copy&#8221; :<br />
                        break;<br />
                    case &#8220;macrotext:paste&#8221;:<br />
                        break;<br />
                    case &#8220;macrotext:clearfield&#8221;:<br />
                        this.Value = String.Empty;<br />
                        break;<br />
                    case &#8220;macrotext:capitalAMacro&#8221;:<br />
                        this.Value = this.Value + &#8220;&amp; #256;&#8221;;<br />
                        break;<br />
                }<br />
            }</p>
<p>            base.HandleMessage(message);</p>
<p>        }<br />
        #endregion<br />
    }<br />
}</p>
<p>Here is my Sitecore web.config entry (the name of my assembly is &#8216;Datacom.FieldTypeExtensions&#8217;, this can be edited via the properties of your .NET project as can be seen in next image below):</p>
<p>&lt;controlSources&gt;<br />
&lt;source mode=&#8221;on&#8221; namespace=&#8221;Datacom.FieldTypeExtensions&#8221;          assembly=&#8221;Datacom.FieldTypeExtensions&#8221; prefix=&#8221;fieldTypeExtension&#8221;/&gt;</p>
<p>My project structure:<br />
<a href="http://richdias.files.wordpress.com/2008/02/project.jpg" title=".NET project"><img src="http://richdias.files.wordpress.com/2008/02/project.thumbnail.jpg" alt=".NET project" /></a></p>
<p>Hopefully someone finds this helpful!</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/richdias.wordpress.com/1/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/richdias.wordpress.com/1/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/richdias.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/richdias.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/richdias.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/richdias.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/richdias.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/richdias.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/richdias.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/richdias.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/richdias.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/richdias.wordpress.com/1/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=richdias.wordpress.com&blog=2729043&post=1&subd=richdias&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://richdias.wordpress.com/2008/02/03/hello-world/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cd1d07890856310e1e046adedc07ad7b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">richdias</media:title>
		</media:content>

		<media:content url="http://richdias.files.wordpress.com/2008/02/macrontext-item.jpg" medium="image">
			<media:title type="html">MacroText item</media:title>
		</media:content>

		<media:content url="http://richdias.files.wordpress.com/2008/02/macrontext-menu-item.jpg" medium="image">
			<media:title type="html">Macron text menu item.</media:title>
		</media:content>

		<media:content url="http://richdias.files.wordpress.com/2008/02/macrontext-field.jpg" medium="image">
			<media:title type="html">Field.</media:title>
		</media:content>

		<media:content url="http://richdias.files.wordpress.com/2008/02/project.thumbnail.jpg" medium="image">
			<media:title type="html">.NET project</media:title>
		</media:content>
	</item>
	</channel>
</rss>