<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<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/"
	>

<channel>
	<title>umbraco &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://en.wordpress.com/tag/umbraco/</link>
	<description>Feed of posts on WordPress.com tagged "umbraco"</description>
	<pubDate>Fri, 25 Dec 2009 16:09:35 +0000</pubDate>

	<generator>http://en.wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[Pimping your content tree without changing the Umbraco core]]></title>
<link>http://detonatorb.wordpress.com/2009/12/01/pimping-your-content-tree-without-changing-the-umbraco-core/</link>
<pubDate>Tue, 01 Dec 2009 11:38:08 +0000</pubDate>
<dc:creator>detonatorb</dc:creator>
<guid>http://detonatorb.wordpress.com/2009/12/01/pimping-your-content-tree-without-changing-the-umbraco-core/</guid>
<description><![CDATA[Today, I will concisely discuss some of the options for changing the Umbraco v4.0.2.1 content tree w]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Today, I will concisely discuss some of the options for changing the Umbraco v4.0.2.1 content tree without modding the Umbraco core.</p>
<p>Armed with this info, you should be able to:</p>
<ol>
<li>Add and delete standard actions in the context menu (right mouseclick on node) for each node separately. </li>
<li>Target changes for nodes only in the content tree </li>
<li>Hide specific nodes based on their DocumentType </li>
<li>Hide nodes based on the user’s UserType      <br /><font color="#000000" size="5" face="Trebuchet MS">       <br /></font>      <br />And along the way if you didn’t know already       <br /><font color="#000000" size="5" face="Trebuchet MS">       <br /></font></li>
<li>Plug into the event system using ApplicationBase </li>
<li>How to add an event </li>
<li>How to get the current user and its UserType </li>
</ol>
<p>&#160;</p>
<p>Now for some code:</p>
<pre class="code"><span style="color:blue;">using </span>System;</pre>
<pre class="code"><span style="color:blue;">using </span>umbraco.BusinessLogic;
<span style="color:blue;">using </span>umbraco.cms.businesslogic.web;
<span style="color:blue;">using </span>umbraco.cms.presentation.Trees;
<span style="color:blue;">using </span>umbraco.interfaces;

<span style="color:blue;">public class </span><span style="color:#2b91af;">wpclass1 </span>: ApplicationBase <span style="color:green;">// do not forget to inherit from ApplicationBase!</span>
{

    <span style="color:blue;">public </span>wpclass1()
    {
        <span style="color:green;">// register an event handler for tree nodes. It gets called before a node is added to the tree for each node.
        </span><span style="color:#2b91af;">BaseContentTree</span>.BeforeNodeRender += <span style="color:blue;">new </span><span style="color:#2b91af;">BaseTree</span>.<span style="color:#2b91af;">BeforeNodeRenderEventHandler</span>(BeforeNodeRenderHandler);
    }

    <span style="color:blue;">private void </span>BeforeNodeRenderHandler(<span style="color:blue;">ref </span><span style="color:#2b91af;">XmlTree </span>sender, <span style="color:blue;">ref </span><span style="color:#2b91af;">XmlTreeNode </span>node, <span style="color:#2b91af;">EventArgs </span>e)
    {
        <span style="color:green;">// make sure we are dealing with a content node and not another type of node (like &#34;media&#34;).
        </span><span style="color:blue;">if </span>(node.NodeType.ToLower() == <span style="color:#a31515;">&#34;content&#34;</span>)
        {
            <span style="color:green;">// okay, now make sure that we are dealing with a user that will be restricted before we do more stuff.
            </span><span style="color:blue;">if </span>(umbraco.<span style="color:#2b91af;">helper</span>.GetCurrentUmbracoUser().UserType.Alias == <span style="color:#a31515;">&#34;myCustomUserType&#34;</span>)
            {
                <span style="color:green;">// now do your stuff like:
                // **********************************************************************
                // hide the node all together:
                </span>node = <span style="color:blue;">null</span>;
                <span style="color:green;">// **********************************************************************
                // or hide a context menu item i.e. &#34;delete&#34;:
                </span><span style="color:blue;">int </span>index = node.Menu.FindIndex(<span style="color:blue;">delegate</span>(<span style="color:#2b91af;">IAction </span>a) { <span style="color:blue;">return </span>a.Alias == <span style="color:#a31515;">&#34;delete&#34;</span>; });
                <span style="color:blue;">if </span>(index &#62; -1) node.Menu.RemoveAt(index);
                <span style="color:green;">// **********************************************************************
                // or remove i.e. the delete menu item for a specific document type:
                </span><span style="color:blue;">if </span>(node.Menu != <span style="color:blue;">null</span>)
                {
                    <span style="color:blue;">int </span>docid = <span style="color:blue;">int</span>.Parse(node.NodeID); <span style="color:green;">// get the Node Id
                    </span><span style="color:#2b91af;">Document </span>doc = <span style="color:blue;">new </span><span style="color:#2b91af;">Document</span>(docid); <span style="color:green;">// get the document
                    // now go check the document type.
                    </span><span style="color:blue;">if </span>(doc.ContentType.Alias.ToLower() == <span style="color:#a31515;">&#34;myCustomDocumentType&#34;</span>)
                    {
                        <span style="color:blue;">int </span>index2 = node.Menu.FindIndex(<span style="color:blue;">delegate</span>(<span style="color:#2b91af;">IAction </span>a) { <span style="color:blue;">return </span>a.Alias == <span style="color:#a31515;">&#34;delete&#34;</span>; });
                        <span style="color:blue;">if </span>(index2 &#62; -1) node.Menu.RemoveAt(index2);
                    }
                }
                <span style="color:green;">// **********************************************************************

            </span>}
        }
    }
}</pre>
<pre class="code">To select certain standard Umbraco Actions (for adding/deleting them to/from context menu’s):</pre>
<table border="0" cellspacing="0" cellpadding="2" width="498">
<tbody>
<tr>
<td valign="top" width="171"><strong>Alias</strong></td>
<td valign="top" width="162"><strong>Letter</strong></td>
<td valign="top" width="163">&#160;</td>
</tr>
<tr>
<td valign="top" width="173">&#160;</td>
<td valign="top" width="161">- (minus sign)</td>
<td valign="top" width="163">(no action)</td>
</tr>
<tr>
<td valign="top" width="175">browse</td>
<td valign="top" width="160">F</td>
<td valign="top" width="162">&#160;</td>
</tr>
<tr>
<td valign="top" width="177">liveEdit</td>
<td valign="top" width="159">:</td>
<td valign="top" width="162">&#160;</td>
</tr>
<tr>
<td valign="top" width="178">&#160;</td>
<td valign="top" width="159">,</td>
<td valign="top" width="161">(separator)</td>
</tr>
<tr>
<td valign="top" width="179">create</td>
<td valign="top" width="158">C</td>
<td valign="top" width="161">&#160;</td>
</tr>
<tr>
<td valign="top" width="180">createFolder</td>
<td valign="top" width="158">!</td>
<td valign="top" width="160">&#160;</td>
</tr>
<tr>
<td valign="top" width="180">sendToTranslate</td>
<td valign="top" width="158">5</td>
<td valign="top" width="160">&#160;</td>
</tr>
<tr>
<td valign="top" width="180">emptyTrashcan</td>
<td valign="top" width="158">N</td>
<td valign="top" width="160">&#160;</td>
</tr>
<tr>
<td valign="top" width="180">translate</td>
<td valign="top" width="158">4</td>
<td valign="top" width="160">&#160;</td>
</tr>
<tr>
<td valign="top" width="180">save</td>
<td valign="top" width="158">0 (zero)</td>
<td valign="top" width="160">&#160;</td>
</tr>
<tr>
<td valign="top" width="180">importDocumentType</td>
<td valign="top" width="158">8</td>
<td valign="top" width="160">&#160;</td>
</tr>
<tr>
<td valign="top" width="180">exportDocumentType</td>
<td valign="top" width="158">9</td>
<td valign="top" width="160">&#160;</td>
</tr>
<tr>
<td valign="top" width="180">auditTrail</td>
<td valign="top" width="158">Z</td>
<td valign="top" width="160">&#160;</td>
</tr>
<tr>
<td valign="top" width="180">importPackage</td>
<td valign="top" width="158">X</td>
<td valign="top" width="160">&#160;</td>
</tr>
<tr>
<td valign="top" width="180">createPackage</td>
<td valign="top" width="158">Y</td>
<td valign="top" width="160">&#160;</td>
</tr>
<tr>
<td valign="top" width="180">delete</td>
<td valign="top" width="158">D</td>
<td valign="top" width="160">&#160;</td>
</tr>
<tr>
<td valign="top" width="180">disable</td>
<td valign="top" width="158">E</td>
<td valign="top" width="160">&#160;</td>
</tr>
<tr>
<td valign="top" width="180">move</td>
<td valign="top" width="158">M</td>
<td valign="top" width="162">&#160;</td>
</tr>
<tr>
<td valign="top" width="180">copy</td>
<td valign="top" width="158">O (letter)</td>
<td valign="top" width="162">&#160;</td>
</tr>
<tr>
<td valign="top" width="180">sort</td>
<td valign="top" width="158">S</td>
<td valign="top" width="162">&#160;</td>
</tr>
<tr>
<td valign="top" width="180">rollback</td>
<td valign="top" width="158">K</td>
<td valign="top" width="162">&#160;</td>
</tr>
<tr>
<td valign="top" width="180">publish</td>
<td valign="top" width="158">U</td>
<td valign="top" width="162">&#160;</td>
</tr>
<tr>
<td valign="top" width="180">assignDomain</td>
<td valign="top" width="158">I</td>
<td valign="top" width="162">&#160;</td>
</tr>
<tr>
<td valign="top" width="180">rights</td>
<td valign="top" width="158">R</td>
<td valign="top" width="162">&#160;</td>
</tr>
<tr>
<td valign="top" width="180">protect</td>
<td valign="top" width="158">P</td>
<td valign="top" width="162">&#160;</td>
</tr>
<tr>
<td valign="top" width="180">notify</td>
<td valign="top" width="158">T</td>
<td valign="top" width="162">&#160;</td>
</tr>
<tr>
<td valign="top" width="180">refreshNode</td>
<td valign="top" width="158">L</td>
<td valign="top" width="162">&#160;</td>
</tr>
<tr>
<td valign="top" width="180">quit</td>
<td valign="top" width="158">Q</td>
<td valign="top" width="162">&#160;</td>
</tr>
</tbody>
</table>
<p>&#160;</p>
<p>Although not discussed in this post, I do have a reminder for fellow developers trying to create custom actions: be careful not to use one of the already defined letters. If you do, the standard action will be included instead of your shiny new one.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[How to use umbraco.library GetMedia in XSLT]]></title>
<link>http://blog.leekelleher.com/2009/11/30/how-to-use-umbraco-library-getmedia-in-xslt/</link>
<pubDate>Mon, 30 Nov 2009 14:33:14 +0000</pubDate>
<dc:creator>Lee Kelleher</dc:creator>
<guid>http://blog.leekelleher.com/2009/11/30/how-to-use-umbraco-library-getmedia-in-xslt/</guid>
<description><![CDATA[From time to time I notice a reoccurring post over at the Our Umbraco forum; how to display an image]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>From time to time I notice a reoccurring post over at the Our Umbraco forum; how to display an image (from the Media section) in XSLT?</p>
<p>A quick answer can be found on the Our Umbraco wiki for the <a href="http://our.umbraco.org/wiki/reference/umbracolibrary/getmedia">umbraco.library GetMedia</a> method.</p>
<p>For most uses, the last example in the wiki works great.  But I want to show you a &#8220;super safe&#8221; way of dealing with GetMedia in XSLT.</p>
<p>Where I find a lot of the examples go wrong is that they make the assumption that a media node (XML) is returned from the GetMedia call, e.g.</p>
<pre class="brush: xml;">&#60;xsl:value-of select=&#34;umbraco.library:GetMedia($currentPage/data[@alias='mediaId'], 'false')/data[@alias='umbracoFile']&#34; /&#62;</pre>
<p>If the &#8216;mediaId&#8217; property didn&#8217;t contain either a numeric value or a valid media node id, then it would return <strong>null</strong> &#8230; meaning that the following &#8220;<strong>/data</strong>&#8221; would throw an Exception! (Displaying &#8220;<em>Error parsing XSLT file</em>&#8221; message on the front-end.)  Not what you or your users want to see!</p>
<p>In order to consider any user inputs, like media IDs not being selected, or even a referenced media node is deleted in the back-office, here is the &#8220;super safe&#8221; approach:</p>
<pre class="brush: xml;">&#60;xsl:template match=&#34;/&#34;&#62;
	&#60;xsl:variable name=&#34;mediaId&#34; select=&#34;number($currentPage/data[@alias='mediaId'])&#34; /&#62;
	&#60;xsl:if test=&#34;$mediaId &#38;gt; 0&#34;&#62;
		&#60;xsl:variable name=&#34;mediaNode&#34; select=&#34;umbraco.library:GetMedia($mediaId, 0)&#34; /&#62;
		&#60;xsl:if test=&#34;count($mediaNode/data) &#38;gt; 0&#34;&#62;
			&#60;xsl:if test=&#34;string($mediaNode/data[@alias='umbracoFile']) != ''&#34;&#62;
				&#60;img src=&#34;{$mediaNode/data[@alias='umbracoFile']}&#34; alt=&#34;[image]&#34;&#62;
					&#60;xsl:if test=&#34;string($mediaNode/data[@alias='umbracoHeight']) != ''&#34;&#62;
						&#60;xsl:attribute name=&#34;height&#34;&#62;
							&#60;xsl:value-of select=&#34;$mediaNode/data[@alias='umbracoHeight']&#34; /&#62;
						&#60;/xsl:attribute&#62;
					&#60;/xsl:if&#62;
					&#60;xsl:if test=&#34;string($mediaNode/data[@alias='umbracoWidth']) != ''&#34;&#62;
						&#60;xsl:attribute name=&#34;width&#34;&#62;
							&#60;xsl:value-of select=&#34;$mediaNode/data[@alias='umbracoWidth']&#34; /&#62;
						&#60;/xsl:attribute&#62;
					&#60;/xsl:if&#62;
				&#60;/img&#62;
			&#60;/xsl:if&#62;
		&#60;/xsl:if&#62;
	&#60;/xsl:if&#62;
&#60;/xsl:template&#62;</pre>
<p>Here&#8217;s what happens:</p>
<ol>
<li>The &#8220;mediaId&#8221; is pulled from a property of the &#8220;currentPage&#8221; and cast as a number.  Optionally the &#8220;mediaId&#8221; could be passed in via a macro parameter, or somewhere else?</li>
<li>The first condition checks the the &#8220;mediaId&#8221; is numeric, and greater-than zero.</li>
<li>The &#8220;mediaId&#8221; is passed through to &#8220;GetMedia&#8221;, along with the <em>false</em> flag to only pull-back the required node (not it&#8217;s children, for Folder media items).</li>
<li>We check if the media node has any child &#8220;data&#8221; elements &#8211; which contain the data about the image/media.</li>
<li>Then we check if the &#8220;umbracoFile&#8221; property has any data &#8211; if not, then there is no point displaying an image.</li>
<li>There are extra conditions for the &#8220;height&#8221; and &#8220;width&#8221; properties &#8211; these are optional.</li>
</ol>
<p>Personally, I add an &#8220;altText&#8221; property to the Image media-type &#8230; and use that in the XSLT &#8211; again this is optional, but strongly recommended!</p>
<p>I can see how this &#8220;super safe&#8221; approach is overkill &#8211; especially compared with a single line of XSLT &#8230; but from my experience, it&#8217;s better to be safe than sorry &#8211; especially when dealing with user data-input &#8211; your assumptions and expectations of how users will use the system aren&#8217;t always correct!</p>
<p><strong><span style="text-decoration:underline;">Update:</span></strong> OK, I agree the extra &#8220;if&#8221; statements are overkill&#8230; so here&#8217;s a condensed version &#8211; assuming that the &#8220;umbracoHeight&#8221; and &#8220;umbracoWidth&#8221; properties are always there&#8230;</p>
<pre class="brush: xml;">&#60;xsl:template match=&#34;/&#34;&#62;
	&#60;xsl:variable name=&#34;mediaId&#34; select=&#34;number($currentPage/data[@alias='mediaId'])&#34; /&#62;
	&#60;xsl:if test=&#34;$mediaId &#38;gt; 0&#34;&#62;
		&#60;xsl:variable name=&#34;mediaNode&#34; select=&#34;umbraco.library:GetMedia($mediaId, 0)&#34; /&#62;
		&#60;xsl:if test=&#34;count($mediaNode/data) &#38;gt; 0 and string($mediaNode/data[@alias='umbracoFile']) != ''&#34;&#62;
			&#60;img src=&#34;{$mediaNode/data[@alias='umbracoFile']}&#34; alt=&#34;[image]&#34; height=&#34;{$mediaNode/data[@alias='umbracoHeight']}&#34; width=&#34;{$mediaNode/data[@alias='umbracoWidth']}&#34; /&#62;
		&#60;/xsl:if&#62;
	&#60;/xsl:if&#62;
&#60;/xsl:template&#62; </pre>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[umbraco : Object reference not set to an instance of an object in administration section]]></title>
<link>http://cosier.wordpress.com/2009/11/24/umbraco-object-reference-not-set-to-an-instance-of-an-object-in-administration-section/</link>
<pubDate>Tue, 24 Nov 2009 00:42:57 +0000</pubDate>
<dc:creator>cosier</dc:creator>
<guid>http://cosier.wordpress.com/2009/11/24/umbraco-object-reference-not-set-to-an-instance-of-an-object-in-administration-section/</guid>
<description><![CDATA[If when you click on a node within your umbraco administration section and you receive the following]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>If when you click on a node within your umbraco administration section and you receive the following:
<p>&#160;</p>
<p><strong>[NullReferenceException: Object reference not set to an instance of an object.]<br />
   umbraco.controls.ContentControl.addControlNew(Property p, TabPage tp, String Caption) +106<br />
   umbraco.controls.ContentControl..ctor(Content c, publishModes CanPublish, String Id) +1057<br />
   umbraco.cms.presentation.editContent.OnInit(EventArgs e) +406<br />
   System.Web.UI.Control.InitRecursive(Control namingContainer) +142<br />
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1476<br />
</strong><strong> </strong>
<p>&#160;</p>
<p>I can tell you that you have added either a custom control, or a control of a certain type does not exist within your bin directory.  I kept receiving this when I created a new umbraco instance &#8211; I think I must have a mismatch of umbraco versions causing my DB to contain a type which does not exist within my assemblies.  Here&#8217;s what I did to debug this issue:
<p>&#160;</p>
<p>1. Downloaded the umbraco source code from codeplex<br />
2. Changed it to &#8216;Debug&#8217; config, rebuilt everything, copied the cms.dll and cms.pdb from the output directory into my umbraco bin folder<br />
3. Typed ctrl+alt+e in visual studio and made sure that the checkbox next to &#8216;thrown&#8217; for common language runtime exceptions was selected.<br />
3. Attached the visual studio instance that currently has the umbraco source code loaded, to w3wp.exe (the one running my umbraco website).<br />
4. Clicked into the admin section, and caused the error by clicking on one of the nodes that has the problem.<br />
5. Visual studio brakes into mscorelib inside an indexer, I used my call stack window to jump up a few frames, which brought me eventually into  DataType.cs
<p>&#160;</p>
<p>6. Line 79 in my version of the code shows:</p>
<p>interfaces.IDataType dt = f.DataType(_controlId);</p>
<p>Essentially what this is doing, is loading an IDataType from the given control ID.  If you hover over the &#8216;Id&#8217; property, this will be your key in determining which control is currently wrong.  Save the contents of both the &#8216;Id&#8217; property and &#8216;_controlId&#8217; into notepad.</p>
<p>7. I jumped into my umbraco database, and select * from cmsDataType</p>
<p>You&#8217;ll notice the control ID in there, you&#8217;ll also notice the controlID you saved is within this table, as is the ID &#8211; this means that you&#8217;ve basically told umbraco that there is a control of that type available somewhere within your *.dll&#8217;s within your bin directory in umbraco (If you look inside the f.DataType() call, youll notice that it does a type resolution by searching for all types of IDataType within the *.dll wildcard search within the umbraco bin folder).</p>
<p>The problem is that it can&#8217;t find that control type within the bin folder.  I haven&#8217;t looked into what exactly that means, but I can only assume you can create custom controls in umbraco by marking them with an attribute guid that matches that control ID, then it will dynamically load that control and use it for that particular data type.  In my case, I have no idea what data type is failing, (and you probably wont either).</p>
<p>To fix the problem temporarily, what I did was simply copy another ControlId Guid from within cmsDataType table (any should do for now, preferably a plain text control ID or something, if you can work out which one that is&#8230; I guessed&#8230;), and update the rows which match &#8217;select * from cmsDataType where ControlId = &#8216;TheControlIdYouSaved&#8217; to be the new guid you just copied from the table.</p>
<p>So you&#8217;re essentially just using a different control ID now instead of the one that isnt working&#8230;.  perform an IISReset, and you should notice your nodes are now clickable&#8230;. click through the tabs and work out which one was causing the issue, and you might be able to figure out what control was missing (if you&#8217;re lucky) and either a) install it into your bin directory or b) update your umbraco version so that the control that was missing is available&#8230;</p>
<p>Cheers guys,</p>
<p>Matt</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Hassling the Umbraco v4.0.2.1 Member webservice to import members]]></title>
<link>http://detonatorb.wordpress.com/2009/11/11/hassling-the-umbraco-v4-0-2-1-member-webservice-to-import-members/</link>
<pubDate>Wed, 11 Nov 2009 09:12:21 +0000</pubDate>
<dc:creator>detonatorb</dc:creator>
<guid>http://detonatorb.wordpress.com/2009/11/11/hassling-the-umbraco-v4-0-2-1-member-webservice-to-import-members/</guid>
<description><![CDATA[I needed to import a shitload of members into an Umbraco 4.0.2.1 system by using webservices and fou]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>I needed to import a shitload of members into an Umbraco 4.0.2.1 system by using webservices and found out some pieces are missing.</p>
<p>For instance, Update didn’t seem to want to work for me and shoving a member in one or more membergroups was stubbornly ignored.</p>
<p>(I know there are some import packages, but I had reasons to do it on a more dynamic basis so I wanted to use the webservices.)</p>
<p>After some fiddling I decided to get my hands dirty and had a look at MemberService.asmx.cs in the umbraco.webservices project (yes, I am talking about the source of the Umbraco core. You can download it <a href="http://umbraco.codeplex.com">here</a>.)</p>
<p>Lo and behold, the code was, well, umm, incomplete. And mind you, it still is after this article. These services don’t seem to be anywhere near completion.</p>
<p>I specifically needed creating members (works out-of-the-box) but also:</p>
<ul>
<li>Adding them to one or more member groups (missing)</li>
<li>Specify a password for these new members (missing)</li>
<li>Specify an email address for these new members (missing)</li>
<li>Updating these members (not working for me)</li>
</ul>
<p>I will tell you how I got these things jiving and that’s it.</p>
<p>I’ll throw in some sample code to import them using the webservices as well. Just for fun.</p>
<p>&#160;</p>
<h2>Update</h2>
<p>I added a member.Save() to the last line of the update webmethod. That is all. It now looks like this:</p>
<pre class="code">[<span style="color:#2b91af;">WebMethod</span>]
        <span style="color:blue;">public void </span>update(<span style="color:#2b91af;">memberCarrier </span>carrier, <span style="color:blue;">string </span>username, <span style="color:blue;">string </span>password)
        {
            Authenticate(username, password);

            <span style="color:green;">// Some validation
            </span><span style="color:blue;">if </span>(carrier.Id == 0) <span style="color:blue;">throw new </span><span style="color:#2b91af;">Exception</span>(<span style="color:#a31515;">"ID must be specifed when updating"</span>);
            <span style="color:blue;">if </span>(carrier == <span style="color:blue;">null</span>) <span style="color:blue;">throw new </span><span style="color:#2b91af;">Exception</span>(<span style="color:#a31515;">"No carrier specified"</span>);

            <span style="color:green;">// Get the user
            </span>umbraco.BusinessLogic.<span style="color:#2b91af;">User </span>user = GetUser(username, password);

            <span style="color:green;">// We load the member
            </span><span style="color:#2b91af;">Member </span>member = <span style="color:blue;">new </span><span style="color:#2b91af;">Member</span>(carrier.Id);

            <span style="color:green;">// We assign the new values:
            </span>member.LoginName = carrier.LoginName;
            member.Text = carrier.DisplayedName;
            member.Email = carrier.Email;
            member.Password = carrier.Password;

            <span style="color:green;">// We iterate the properties in the carrier
            </span><span style="color:blue;">if </span>(carrier.MemberProperties != <span style="color:blue;">null</span>)
            {
                <span style="color:blue;">foreach </span>(<span style="color:#2b91af;">memberProperty </span>updatedproperty <span style="color:blue;">in </span>carrier.MemberProperties)
                {
                    umbraco.cms.businesslogic.property.<span style="color:#2b91af;">Property </span>property = member.getProperty(updatedproperty.Key);
                    <span style="color:blue;">if </span>(property != <span style="color:blue;">null</span>)
                    {
                        property.Value = updatedproperty.PropertyValue;
                    }
                }
            }
            member.Save();   <span style="color:green;">// ##CT# &#60;-- I needed this to get the update working.
        </span>}</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<h2>Grouping</h2>
<p>This one is easy too. Just add a section iterating the groups and adding the member to the group. Oh and check if the group exists of course. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>By the way, apparantly, when I wrote this, I had trouble setting the password and the email address of the member too. So I added extra lines for this too.</p>
<pre class="code">[<span style="color:#2b91af;">WebMethod</span>]
        <span style="color:blue;">public int </span>create(<span style="color:#2b91af;">memberCarrier </span>carrier, <span style="color:blue;">int </span>memberTypeId, <span style="color:blue;">string </span>username, <span style="color:blue;">string </span>password)
        {
            Authenticate(username, password);

            <span style="color:green;">// Some validation
            </span><span style="color:blue;">if </span>(carrier == <span style="color:blue;">null</span>) <span style="color:blue;">throw new </span><span style="color:#2b91af;">Exception</span>(<span style="color:#a31515;">"No carrier specified"</span>);
            <span style="color:blue;">if </span>(carrier.Id != 0) <span style="color:blue;">throw new </span><span style="color:#2b91af;">Exception</span>(<span style="color:#a31515;">"ID cannot be specifed when creating. Must be 0"</span>);
            <span style="color:blue;">if </span>(<span style="color:blue;">string</span>.IsNullOrEmpty(carrier.DisplayedName)) carrier.DisplayedName = <span style="color:#a31515;">"unnamed"</span>;

            <span style="color:green;">// we fetch the membertype
            </span>umbraco.cms.businesslogic.member.<span style="color:#2b91af;">MemberType </span>mtype = <span style="color:blue;">new </span>umbraco.cms.businesslogic.member.<span style="color:#2b91af;">MemberType</span>(memberTypeId);

            <span style="color:green;">// Check if the membertype exists
            </span><span style="color:blue;">if </span>(mtype == <span style="color:blue;">null</span>) <span style="color:blue;">throw new </span><span style="color:#2b91af;">Exception</span>(<span style="color:#a31515;">"Membertype " </span>+ memberTypeId + <span style="color:#a31515;">" not found"</span>);

            <span style="color:green;">// Get the user that creates
            </span>umbraco.BusinessLogic.<span style="color:#2b91af;">User </span>user = GetUser(username, password);

            <span style="color:green;">// Create the new member
            </span>umbraco.cms.businesslogic.member.<span style="color:#2b91af;">Member </span>newMember = umbraco.cms.businesslogic.member.<span style="color:#2b91af;">Member</span>.MakeNew(carrier.DisplayedName, mtype, user);
            newMember.Password = carrier.Password;          <span style="color:green;">// ##CT#    &#60;-- oh yeah I needed this too.
            </span>newMember.Email = carrier.Email;                <span style="color:green;">// ##CT#    &#60;-- and this.
            </span>newMember.Save();
            <span style="color:green;">// &#60;##CT##&#62;             &#60;-- this is the start of what I added for the assignment to membergroups
            </span><span style="color:blue;">if </span>(carrier.Groups != <span style="color:blue;">null</span>)
            {
                <span style="color:blue;">foreach </span>(<span style="color:#2b91af;">memberGroup </span>mg <span style="color:blue;">in </span>carrier.Groups)
                {
                    <span style="color:blue;">if </span>(mg.GroupID != 0)
                    {
                        newMember.AddGroup(mg.GroupID);
                    }
                    <span style="color:blue;">else
                    </span>{
                        <span style="color:blue;">if </span>(!<span style="color:blue;">string</span>.IsNullOrEmpty(mg.GroupName))
                        {
                            <span style="color:#2b91af;">MemberGroup </span>mg2 = <span style="color:#2b91af;">MemberGroup</span>.GetByName(mg.GroupName);
                            <span style="color:blue;">if </span>(mg2 != <span style="color:blue;">null</span>)
                            {
                                newMember.AddGroup(mg2.Id);
                            }
                            <span style="color:blue;">else
                            </span>{
                                <span style="color:blue;">throw new </span><span style="color:#2b91af;">Exception</span>(<span style="color:#a31515;">"Group " </span>+ mg.GroupName + <span style="color:#a31515;">" does not exist"</span>);
                            }
                        }
                        <span style="color:blue;">else
                        </span>{
                            <span style="color:blue;">throw new </span><span style="color:#2b91af;">Exception</span>(<span style="color:#a31515;">"Set either the Id or the GroupName of the group"</span>);
                        }
                    }
                }
            }
            <span style="color:green;">// &#60;/##CT##&#62;  &#60;-- this is the end of the part I added
            // We iterate the properties in the carrier
            </span><span style="color:blue;">if </span>(carrier.MemberProperties != <span style="color:blue;">null</span>)
            {
                <span style="color:blue;">foreach </span>(<span style="color:#2b91af;">memberProperty </span>updatedproperty <span style="color:blue;">in </span>carrier.MemberProperties)
                {
                    umbraco.cms.businesslogic.property.<span style="color:#2b91af;">Property </span>property = newMember.getProperty(updatedproperty.Key);
                    <span style="color:blue;">if </span>(property != <span style="color:blue;">null</span>)
                    {
                        property.Value = updatedproperty.PropertyValue;
                    }
                }
            }
            <span style="color:blue;">return </span>newMember.Id;
        }</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>&#160;</p>
<p>Be sure to back up your current umbraco.webservices.dll before proceeding. You use my blog always at your own risk.</p>
<p>Now recompile the project and copy the assembly into the bin directory of your Umbraco site.</p>
<p>&#160;</p>
<h2>Importing members through the webservice (MemberService)</h2>
<p>I am using Visual Studio 2008.</p>
<p>I assume you have a C# project set up. In my case it was a winform app.</p>
<p>Make sure you make a reference to the webservice:</p>
<p>Right mouse click on the project in your Solution Explorer –&#62; Add Web Reference –&#62; type in the location (URL): <a title="http://localhost/umbraco/webservices/api/memberservice.asmx" href="http://localhost/umbraco/webservices/api/memberservice.asmx">http://localhost/umbraco/webservices/api/memberservice.asmx</a> (or your specific path to the memberservice.asmx file)</p>
<p>Don’t forget to enter a name (I used umbraco1 in the next code snip) and hit Add Reference.</p>
<p>&#160;</p>
<p>After that, VS2008 creates your proxies and such automatically (never mind if you don’t know what I’m about).</p>
<p>Then, make sure you have defined a membertype in the back-end of umbraco and (for the following code snippet) added membergroups Group1 and Group2. Besides that the code assumes you have defined 2 custom properties for the member named customproperty1 and customproperty2.</p>
<p>Also, I felt naughty and used the ID for the membertype directly in the code (1081). You should at least change this to your membertype ID (hover over the membertype in the tree in the back-end of Umbraco and you’ll see it in the far lower left corner of your browser) but if this is not a one-off you should absolutely and most definitely look it up using it’s alias.</p>
<p>Now you can start adding members. Here’s an example:</p>
<pre class="code"><span style="color:blue;">private void </span>ImportUser()
        {
            umbraco1.memberService svc = <span style="color:blue;">new </span>umbraco1.memberService();

            umbraco1.memberCarrier mc = <span style="color:blue;">new </span>umbraco1.memberCarrier();

            mc.LoginName = <span style="color:#a31515;">"mymailaddress@nowhere.com"</span>;
            mc.Password = <span style="color:#a31515;">"myPassword"</span>;
            mc.DisplayedName = <span style="color:#a31515;">"DetonatorB"</span>;

            <span style="color:green;">// ADD user to memberGROUPS
            </span>umbraco1.memberGroup mg = <span style="color:blue;">new </span>umbraco1.memberGroup();
            mg.GroupName = <span style="color:#a31515;">"Group1"</span>;

            umbraco1.memberGroup mg2 = <span style="color:blue;">new </span>umbraco1.memberGroup();
            mg2.GroupName = <span style="color:#a31515;">"Group2"</span>;

            mc.Groups = <span style="color:blue;">new </span>umbraco1.memberGroup[] { mg,mg2 };

            <span style="color:green;">// add two properties. These properties must already be defined in the user type!
            </span>umbraco1.memberProperty mp = <span style="color:blue;">new </span>umbraco1.memberProperty();
            mp.Key = <span style="color:#a31515;">"customproperty1"</span>;
            mp.PropertyValue = <span style="color:#a31515;">"myValue"</span>;

            umbraco1.memberProperty mp2 = <span style="color:blue;">new </span>umbraco1.memberProperty();
            mp2.Key = <span style="color:#a31515;">"customproperty2"</span>;
            mp2.PropertyValue = <span style="color:#a31515;">"myValue"</span>;

            mc.MemberProperties = <span style="color:blue;">new </span>umbraco1.memberProperty[] { mp, mp2 };

            <span style="color:green;">// actually create the member
            </span>svc.create(mc, 1081, <span style="color:#a31515;">"&#60;yourADMINusername&#62;"</span>, <span style="color:#a31515;">"&#60;yourADMINpassword&#62;"</span>);   <span style="color:green;">// 1081 is an ID for the membertype                    

            </span>}
        }</pre>
<pre class="code"><span style="font-family:Trebuchet MS;">Well, that’s it for today.</span></pre>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Setting up User and Members membership provider with encrypted passwords]]></title>
<link>http://detonatorb.wordpress.com/2009/11/10/setting-up-user-and-members-membership-provider-with-encrypted-passwords/</link>
<pubDate>Tue, 10 Nov 2009 15:47:26 +0000</pubDate>
<dc:creator>detonatorb</dc:creator>
<guid>http://detonatorb.wordpress.com/2009/11/10/setting-up-user-and-members-membership-provider-with-encrypted-passwords/</guid>
<description><![CDATA[Now, you know everything that I&#8217;ll have you do in this article will be at your own risk don]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Now, you know everything that I&#8217;ll have you do in this article will be at your own risk don&#8217;t you?<br />
If you disagree, you may want to head somewhere else now.</p>
<p><strong>This article tells you how to set up the Umbraco v4.0.2.1 membership providers with encrypted passwords.</strong></p>
<p>Out-of-the-box v4.0.2.1 forks you the clear-text version. Although some people will argue that if someone is able to access the database, they can already do serious harm, there are plenty of reasons left to encrypt them anyway. One of them being compliant to several client and governmental requirements for secure websites.</p>
<p>Changing the password format for your membershipproviders (in umbraco you have 2, one for users and one for members) could make you feel like a one legged man in an ass kicking contest if you do it wrong; you will shut yourself out.<br />
The following instruction is best done on an empty Umbraco installation because the passwords of existing members and users are not encrypted automatically.</p>
<ol>
<li><span style="color:#ff0000;">IMPORTANT</span>: Log into your Umbraco back-end as an administrator. <span style="color:#ff0000;">Keep this window open</span> as you&#8217;ll need it to reset the administrator password after we&#8217;re done. Loose the browser and you&#8217;ll feel like a cat flap in an elephant house in a few minutes.</li>
<li>Edit the web.config and make sure the providers are configured like this<br />
<blockquote>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&#38;" lang="EN-US">&#60;</span><span style="font-size:10pt;font-family:&#38;" lang="EN-US">membership</span><span style="font-size:10pt;font-family:&#38;" lang="EN-US"> </span><span style="font-size:10pt;font-family:&#38;" lang="EN-US">defaultProvider</span><span style="font-size:10pt;font-family:&#38;" lang="EN-US">=</span><span style="font-size:10pt;font-family:&#38;" lang="EN-US">&#8220;<span style="color:blue;">UmbracoMembershipProvider</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">userIsOnlineTimeWindow</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">15</span>&#8220;<span style="color:blue;">&#62;</span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&#38;" lang="EN-US">&#60;</span><span style="font-size:10pt;font-family:&#38;" lang="EN-US">providers</span><span style="font-size:10pt;font-family:&#38;" lang="EN-US">&#62;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&#38;" lang="EN-US">&#60;</span><span style="font-size:10pt;font-family:&#38;" lang="EN-US">clear</span><span style="font-size:10pt;font-family:&#38;" lang="EN-US"> /&#62;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&#38;" lang="EN-US">&#60;</span><span style="font-size:10pt;font-family:&#38;" lang="EN-US">add</span><span style="font-size:10pt;font-family:&#38;" lang="EN-US"> </span><span style="font-size:10pt;font-family:&#38;" lang="EN-US">name</span><span style="font-size:10pt;font-family:&#38;" lang="EN-US">=</span><span style="font-size:10pt;font-family:&#38;" lang="EN-US">&#8220;<span style="color:blue;">UmbracoMembershipProvider</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">type</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">umbraco.providers.members.UmbracoMembershipProvider</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">enablePasswordRetrieval</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">true</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">enablePasswordReset</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">true</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">passwordFormat</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">encrypted</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">requiresQuestionAndAnswer</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">false</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">defaultMemberTypeAlias</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">Aangemeld</span>&#8220;<span style="color:blue;"> /&#62;</span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&#38;" lang="EN-US">&#60;</span><span style="font-size:10pt;font-family:&#38;" lang="EN-US">add</span><span style="font-size:10pt;font-family:&#38;" lang="EN-US"> </span><span style="font-size:10pt;font-family:&#38;" lang="EN-US">name</span><span style="font-size:10pt;font-family:&#38;" lang="EN-US">=</span><span style="font-size:10pt;font-family:&#38;" lang="EN-US">&#8220;<span style="color:blue;">AspNetSqlMemberShipProvider</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">type</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">System.Web.Security.SqlMembershipProvider</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">connectionStringName</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">LocalSqlServer</span>&#8220;<span style="color:blue;"> /&#62;</span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&#38;" lang="EN-US">&#60;</span><span style="font-size:10pt;font-family:&#38;" lang="EN-US">add</span><span style="font-size:10pt;font-family:&#38;" lang="EN-US"> </span><span style="font-size:10pt;font-family:&#38;" lang="EN-US">name</span><span style="font-size:10pt;font-family:&#38;" lang="EN-US">=</span><span style="font-size:10pt;font-family:&#38;" lang="EN-US">&#8220;<span style="color:blue;">UsersMembershipProvider</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">type</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">umbraco.providers.UsersMembershipProvider</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">enablePasswordRetrieval</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">true</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">enablePasswordReset</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">true</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">requiresQuestionAndAnswer</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">false</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">passwordFormat</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">encrypted</span>&#8220;<span style="color:blue;"> /&#62;</span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&#38;" lang="EN-US"> </span><span style="font-size:10pt;font-family:&#38;">&#60;/</span><span style="font-size:10pt;font-family:&#38;">providers</span><span style="font-size:10pt;font-family:&#38;">&#62;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&#38;">&#60;/</span><span style="font-size:10pt;font-family:&#38;">membership</span><span style="font-size:10pt;font-family:&#38;">&#62;</span></p>
</blockquote>
<p>Notice <span style="font-size:10pt;font-family:&#38;" lang="EN-US"><span style="color:red;">passwordFormat</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">encrypted</span>&#8220;<span style="color:blue;"> </span></span>on both of the providers.</li>
<li>Now we need to provide a couple of keys for the memberproviders to encrypt/decrypt the passwords with. For that, we set up what is known as a MachineKey in the web.config.</li>
<li>Go to this <a title="MachineKey Generator" href="http://www.orcsweb.com/articles/aspnetmachinekey.aspx" target="_blank">MachineKey generator</a> and paste the &#60;machinekey&#62; tag into your web.config (somewhere inside system.web). Off course it is a bad idea to publish your keys, so these are completely fictional<br />
<blockquote>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&#38;" lang="EN-US">&#60;</span><span style="color:#800000;"><span style="font-size:10pt;" lang="EN-US">machineKey</span></span><span style="font-size:10pt;font-family:&#38;" lang="EN-US"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&#38;" lang="EN-US"> </span><span style="color:#ff0000;"><span style="font-size:10pt;" lang="EN-US">validationKey</span></span><span style="font-size:10pt;font-family:&#38;" lang="EN-US">=</span><span style="font-size:10pt;font-family:&#38;" lang="EN-US">&#8216;<span style="color:blue;">B5A70DA29F2D0BCF09099E8E5BF2DC77E4AD67434210F4AAC384AE738927B4EB0A31B4A4586DB45E59E6501028B7B5DAA27EE423950E502B65FBA96FA5132483</span>&#8216;<span style="color:blue;"> </span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&#38;" lang="EN-US"> </span><span style="color:#ff0000;"><span style="font-size:10pt;" lang="EN-US">decryptionKey</span></span><span style="font-size:10pt;font-family:&#38;" lang="EN-US">=</span><span style="font-size:10pt;font-family:&#38;" lang="EN-US">&#8216;<span style="color:blue;">CFACC7400F035B030D8FD75999129C0465164FF5D896BB05</span>&#8216;<span style="color:blue;"> </span></span></p>
<p class="MsoNormal"><span style="color:#ff0000;"><span style="font-size:10pt;" lang="EN-US">decryption</span></span><span style="font-size:10pt;font-family:&#38;" lang="EN-US">=</span><span style="font-size:10pt;font-family:&#38;" lang="EN-US">&#8220;<span style="color:blue;">3DES</span>&#8220;</span></p>
<p class="MsoNormal"><span style="color:#ff0000;"><span style="font-size:10pt;">validation</span></span><span style="font-size:10pt;font-family:&#38;">=</span><span style="font-size:10pt;font-family:&#38;">&#8216;<span style="color:blue;">SHA1</span>&#8216;<span style="color:blue;">/&#62;</span></span><span style="font-size:8pt;font-family:&#38;"> </span></p>
<p class="MsoNormal"> </p>
</blockquote>
<p class="MsoNormal"> </p>
<p>And don&#8217;t you use these either.</li>
<li>Now for another important part. Remember the browser logged into the back-end I told you to keep open? Well, you&#8217;re gonna need it now to reset/change the password for your adminstrator so it is saved in the new encrypted  format. If you don&#8217;t and log out first, you will not be able to get in again easily. As said, your user&#8217;s and member&#8217;s passwords will not be automatically changed to an encrypted format. Failing to re-set the password will effectively prevent the members and users to login.<br />
That&#8217;s why you should try to do this before you add many users or members. Of course I am never to lazy to code something for this if you provide the right incentive ;p</li>
</ol>
<p><!--  /* Font Definitions */  @font-face 	{font-family:"Cambria Math"; 	panose-1:2 4 5 3 5 4 6 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:roman; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1107304683 0 0 159 0;} @font-face 	{font-family:Calibri; 	panose-1:2 15 5 2 2 2 4 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1073750139 0 0 159 0;} @font-face 	{font-family:Verdana; 	panose-1:2 11 6 4 3 5 4 4 2 4; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-pitch:variable; 	mso-font-signature:536871559 0 0 0 415 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin:0cm; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi; 	mso-fareast-language:EN-US;} span.E-mailStijl15 	{mso-style-type:personal; 	mso-style-noshow:yes; 	mso-style-unhide:no; 	mso-ansi-font-size:8.0pt; 	mso-bidi-font-size:10.0pt; 	font-family:"Verdana","sans-serif"; 	mso-ascii-font-family:Verdana; 	mso-hansi-font-family:Verdana; 	color:blue; 	mso-text-animation:none; 	font-weight:normal; 	font-style:normal; 	text-decoration:none; 	text-underline:none; 	text-decoration:none; 	text-line-through:none;} .MsoChpDefault 	{mso-style-type:export-only; 	mso-default-props:yes; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi; 	mso-fareast-language:EN-US;} @page Section1 	{size:612.0pt 792.0pt; 	margin:70.85pt 70.85pt 70.85pt 70.85pt; 	mso-header-margin:35.4pt; 	mso-footer-margin:35.4pt; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --></p>
<div id="_mcePaste" style="position:absolute;width:1px;height:1px;overflow:hidden;top:0;left:-10000px;">&#60;!&#8211;[if gte mso 9]&#62; Normal 0 21 false false false NL X-NONE X-NONE MicrosoftInternetExplorer4 &#60;![endif]&#8211;&#62;&#60;!&#8211;[if gte mso 9]&#62; &#60;![endif]&#8211;&#62;<!--  /* Font Definitions */  @font-face 	{font-family:"Cambria Math"; 	panose-1:2 4 5 3 5 4 6 3 2 4; 	mso-font-charset:1; 	mso-generic-font-family:roman; 	mso-font-format:other; 	mso-font-pitch:variable; 	mso-font-signature:0 0 0 0 0 0;} @font-face 	{font-family:Calibri; 	panose-1:2 15 5 2 2 2 4 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1073750139 0 0 159 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin-top:0cm; 	margin-right:0cm; 	margin-bottom:10.0pt; 	margin-left:0cm; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi; 	mso-fareast-language:EN-US;} .MsoChpDefault 	{mso-style-type:export-only; 	mso-default-props:yes; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi; 	mso-fareast-language:EN-US;} .MsoPapDefault 	{mso-style-type:export-only; 	margin-bottom:10.0pt; 	line-height:115%;} @page Section1 	{size:595.3pt 841.9pt; 	margin:70.85pt 70.85pt 70.85pt 70.85pt; 	mso-header-margin:35.4pt; 	mso-footer-margin:35.4pt; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --><!--[if gte mso 10]&#62; &#60;!   /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:Standaardtabel; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-priority:99; 	mso-style-qformat:yes; 	mso-style-parent:&#34;&#34;; 	mso-padding-alt:0cm 5.4pt 0cm 5.4pt; 	mso-para-margin-top:0cm; 	mso-para-margin-right:0cm; 	mso-para-margin-bottom:10.0pt; 	mso-para-margin-left:0cm; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:&#34;Calibri&#34;,&#34;sans-serif&#34;; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:&#34;Times New Roman&#34;; 	mso-fareast-theme-font:minor-fareast; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin;} --> &#60;!&#8211;[endif]&#8211;&#62;</div>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&#38;" lang="EN-US">&#60;</span><span style="font-size:10pt;font-family:&#38;" lang="EN-US">membership</span><span style="font-size:10pt;font-family:&#38;" lang="EN-US"> </span><span style="font-size:10pt;font-family:&#38;" lang="EN-US">defaultProvider</span><span style="font-size:10pt;font-family:&#38;" lang="EN-US">=</span><span style="font-size:10pt;font-family:&#38;" lang="EN-US">&#8220;<span style="color:blue;">UmbracoMembershipProvider</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">userIsOnlineTimeWindow</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">15</span>&#8220;<span style="color:blue;">&#62;</span></span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&#38;" lang="EN-US">&#60;</span><span style="font-size:10pt;font-family:&#38;" lang="EN-US">providers</span><span style="font-size:10pt;font-family:&#38;" lang="EN-US">&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&#38;" lang="EN-US">&#60;</span><span style="font-size:10pt;font-family:&#38;" lang="EN-US">clear</span><span style="font-size:10pt;font-family:&#38;" lang="EN-US"> /&#62;</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&#38;" lang="EN-US">&#60;</span><span style="font-size:10pt;font-family:&#38;" lang="EN-US">add</span><span style="font-size:10pt;font-family:&#38;" lang="EN-US"> </span><span style="font-size:10pt;font-family:&#38;" lang="EN-US">name</span><span style="font-size:10pt;font-family:&#38;" lang="EN-US">=</span><span style="font-size:10pt;font-family:&#38;" lang="EN-US">&#8220;<span style="color:blue;">UmbracoMembershipProvider</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">type</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">umbraco.providers.members.UmbracoMembershipProvider</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">enablePasswordRetrieval</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">true</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">enablePasswordReset</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">true</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">passwordFormat</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">encrypted</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">requiresQuestionAndAnswer</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">false</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">defaultMemberTypeAlias</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">Aangemeld</span>&#8220;<span style="color:blue;"> /&#62;</span></span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&#38;" lang="EN-US">&#60;</span><span style="font-size:10pt;font-family:&#38;" lang="EN-US">add</span><span style="font-size:10pt;font-family:&#38;" lang="EN-US"> </span><span style="font-size:10pt;font-family:&#38;" lang="EN-US">name</span><span style="font-size:10pt;font-family:&#38;" lang="EN-US">=</span><span style="font-size:10pt;font-family:&#38;" lang="EN-US">&#8220;<span style="color:blue;">AspNetSqlMemberShipProvider</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">type</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">System.Web.Security.SqlMembershipProvider</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">connectionStringName</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">LocalSqlServer</span>&#8220;<span style="color:blue;"> /&#62;</span></span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&#38;" lang="EN-US">&#60;</span><span style="font-size:10pt;font-family:&#38;" lang="EN-US">add</span><span style="font-size:10pt;font-family:&#38;" lang="EN-US"> </span><span style="font-size:10pt;font-family:&#38;" lang="EN-US">name</span><span style="font-size:10pt;font-family:&#38;" lang="EN-US">=</span><span style="font-size:10pt;font-family:&#38;" lang="EN-US">&#8220;<span style="color:blue;">UsersMembershipProvider</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">type</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">umbraco.providers.UsersMembershipProvider</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">enablePasswordRetrieval</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">true</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">enablePasswordReset</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">true</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">requiresQuestionAndAnswer</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">false</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">passwordFormat</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">encrypted</span>&#8220;<span style="color:blue;"> /&#62;</span></span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&#38;">&#60;/</span><span style="font-size:10pt;font-family:&#38;">providers</span><span style="font-size:10pt;font-family:&#38;">&#62;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;line-height:115%;font-family:&#38;">&#60;/</span><span style="font-size:10pt;line-height:115%;font-family:&#38;">membership</span><span style="font-size:10pt;line-height:115%;font-family:&#38;">&#62;</span></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[I 20 CMS Più Popolari Secondo CMSWire]]></title>
<link>http://lorenzobergamini.wordpress.com/2009/10/27/i-20-cms-piu-popolari-secondo-cmswire/</link>
<pubDate>Tue, 27 Oct 2009 17:56:04 +0000</pubDate>
<dc:creator>lorenzobergamini</dc:creator>
<guid>http://lorenzobergamini.wordpress.com/2009/10/27/i-20-cms-piu-popolari-secondo-cmswire/</guid>
<description><![CDATA[CMSWire è un portale Web dedicato interamente al mercato dei CMS (Content Management System) Open So]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><div style="text-align:center;"><a href="http://lorenzobergamini.myblog.it/media/01/01/1765059675.jpg" target="_blank"><img style="border-width:0;margin:.7em 0;" src="http://lorenzobergamini.myblog.it/media/01/01/2045230647.jpg" alt="bli-argomenti-20-cms-popolar-secondo-cmswire.jpg" /></a></div>
<p style="text-align:center;"><span style="font-size:10pt;"><span style="font-family:verdana,geneva;"><strong><br /></strong></span></span></p>
<p><span style="font-size:10pt;"><span style="font-family:verdana,geneva;"><strong>CMSWire</strong> è un portale Web dedicato interamente al mercato dei <em><strong>CMS</strong></em> (Content Management System) <em><strong>Open Source</strong></em>.</span></span></p>
<table style="width:100%;" border="0">
<tbody>
<tr style="text-align:left;">
<td style="background-color:#ffffcc;width:5px;text-align:left;"></td>
<td style="background-color:#ccffff;text-align:left;">
<p><span style="font-size:10pt;"><span style="font-family:verdana,geneva;">Ulteriori informazioni:</span></span><span style="font-size:10pt;"><span style="font-family:verdana,geneva;"><a title="eCommerce: Caratteristiche Di VirtueMart" href="http://admin.blog.virgilio.it/admin/posts/faq-e-termini-servizio/caratteristiche-ecommerce-virtuemart.html" target="_blank"></a></span></span></p>
<ul>
<li><span style="font-size:10pt;"><span style="font-family:verdana,geneva;">sui <em><strong>C.M.S.</strong></em> alla pagina</span></span> <a title="I 21 popolari CMS free e le loro risorse" href="http://www.bli.it/news-e-articoli/il-meglio-dal-web/attualita-e-argomenti/181-i-21-popolari-cms-free-e-le-loro-risorse.html" target="_blank"><span style="font-size:10pt;"><span style="font-family:verdana,geneva;"><span style="color:#ff0000;"><em><strong>I 21 Popolari CMS E Le Loro Risorse</strong></em></span></span></span></a></li>
</ul>
</td>
</tr>
</tbody>
</table>
<p><span style="font-size:10pt;"><span style="font-family:verdana,geneva;"><strong>CMSWire </strong></span></span><span style="font-size:10pt;"><span style="font-family:verdana,geneva;">ha recente pubblicato <strong>Open Source CMS Market Share Report</strong> edizione 2009 sui <em><strong>CMS</strong></em> più utilizzati in <em><strong>Internet</strong></em>. Questa edizione prende in considerazione 20 <em><strong>CMS</strong></em> e più precisamente:</span></span></p>
<ul>
<li><span style="font-size:10pt;"><span style="font-family:verdana,geneva;">Alfresco</span></span></li>
<li><span style="font-size:10pt;"><span style="font-family:verdana,geneva;">CMS Made Simple</span></span></li>
<li><span style="font-size:10pt;"><span style="font-family:verdana,geneva;">DotNetNuke</span></span></li>
<li><span style="font-size:10pt;"><span style="font-family:verdana,geneva;">Drupal</span></span></li>
<li><span style="font-size:10pt;"><span style="font-family:verdana,geneva;">e107</span></span></li>
<li><span style="font-size:10pt;"><span style="font-family:verdana,geneva;">eZ Publish</span></span></li>
<li><span style="font-size:10pt;"><span style="font-family:verdana,geneva;">Jahia</span></span></li>
<li><span style="font-size:10pt;"><span style="font-family:verdana,geneva;">Joomla!</span></span></li>
<li><span style="font-size:10pt;"><span style="font-family:verdana,geneva;">Liferay</span></span></li>
<li><span style="font-size:10pt;"><span style="font-family:verdana,geneva;">MODx</span></span></li>
<li><span style="font-size:10pt;"><span style="font-family:verdana,geneva;">OpenCms</span></span></li>
<li><span style="font-size:10pt;"><span style="font-family:verdana,geneva;">phpWebSite</span></span></li>
<li><span style="font-size:10pt;"><span style="font-family:verdana,geneva;">Plone</span></span></li>
<li><span style="font-size:10pt;"><span style="font-family:verdana,geneva;">SilverStripe</span></span></li>
<li><span style="font-size:10pt;"><span style="font-family:verdana,geneva;">Textpattern</span></span></li>
<li><span style="font-size:10pt;"><span style="font-family:verdana,geneva;">TikiWiki</span></span></li>
<li><span style="font-size:10pt;"><span style="font-family:verdana,geneva;">Typo3</span></span></li>
<li><span style="font-size:10pt;"><span style="font-family:verdana,geneva;">Umbraco</span></span></li>
<li><span style="font-size:10pt;"><span style="font-family:verdana,geneva;">WordPress</span></span></li>
<li><span style="font-size:10pt;"><span style="font-family:verdana,geneva;">Xoops</span></span></li>
</ul>
<p><span style="font-size:10pt;"><span style="font-family:verdana,geneva;">Dalla lista è possibile notare che sono stati esclusi <em><strong>CMS</strong></em> noti come <em><strong>Mambo</strong></em> (da cui è nato <em>Joomla!</em>) e <strong><em>PhpNuke</em></strong>, inserendo realtà emergenti come <strong><em>Umbraco</em></strong> e <em><strong>Jahia</strong></em>.</span></span></p>
<p><span style="font-size:10pt;"><span style="font-family:verdana,geneva;"><a title="I 20 CMS Più Popolari Secondo CMSWire" href="http://www.bli.it/news-e-articoli/il-meglio-dal-web/attualita-e-argomenti/284-i-20-cms-piu-popolari-secondo-cmswire.html" target="_blank">Leggi tutto l&#8217;articolo su <span style="color:#ff0000;"><em><strong>I 20 CMS Più Popolari Secondo CMSWire</strong></em></span></a>.</span></span></p>
<div style="text-align:justify;"><span style="font-size:10pt;"><span style="font-family:verdana,geneva;"><span style="font-family:verdana,geneva;"><span style="font-size:10pt;"><br /></span></span></span></span></div>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Insert [content data] into HTML control - XSLT]]></title>
<link>http://lifeisimple.wordpress.com/2009/10/23/169/</link>
<pubDate>Fri, 23 Oct 2009 04:37:19 +0000</pubDate>
<dc:creator>lifeisimple</dc:creator>
<guid>http://lifeisimple.wordpress.com/2009/10/23/169/</guid>
<description><![CDATA[The first example is more verbose than the second, as the second uses the shortcut method of includi]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><blockquote><p>The first example is more verbose than the second, as the second uses the shortcut method of including commands inside existing tags such as the anchor (a) tag.  The first example uses the xslt commands to inject the attribute into the preceding tag</p>
<p style="padding-left:30px;"><span style="color:#3366ff;">&#60;ul&#62;</span></p>
<p style="padding-left:30px;"><span style="color:#3366ff;">&#60;xsl:for-each select=&#8221;$currentPage/node&#8221;&#62;</span></p>
<p style="padding-left:30px;"><span style="color:#3366ff;">&#60;li&#62;&#60;a&#62;</span></p>
<p style="padding-left:30px;"><span style="color:#3366ff;">&#60;xsl:attribute name=&#8221;href&#8221;&#62;</span></p>
<p style="padding-left:30px;"><span style="color:#3366ff;">&#60;xsl:value-of select=&#8221;umbraco.library:NiceUrl(current()/@id)&#8221;/&#62;</span></p>
<p style="padding-left:30px;"><span style="color:#3366ff;">&#60;/xsl:attribute&#62;</span></p>
<p style="padding-left:30px;"><span style="color:#3366ff;">&#60;xsl:value-of select=&#8221;current()/@nodeName&#8221;/&#62;</span></p>
<p style="padding-left:30px;"><span style="color:#3366ff;">&#60;/a&#62;&#60;/li&#62;</span></p>
<p style="padding-left:30px;"><span style="color:#3366ff;">&#60;/xsl:for-each&#62;</span></p>
<p style="padding-left:30px;"><span style="color:#3366ff;">&#60;/ul&#62;</span></p>
</blockquote>
<p style="padding-left:30px;">or</p>
<blockquote>
<p style="padding-left:30px;"><span style="color:#3366ff;">&#60;ul&#62;</span></p>
<p style="padding-left:30px;"><span style="color:#3366ff;">&#60;xsl:for-each select=&#8221;$currentPage/node&#8221;&#62;</span></p>
<p style="padding-left:30px;"><span style="color:#3366ff;">&#60;li&#62;&#60;a href=&#8221;{umbraco.library:NiceUrl(current()/@id)}&#8221;&#62;</span></p>
<p style="padding-left:30px;"><span style="color:#3366ff;">&#60;xsl:value-of select=&#8221;current()/@nodeName&#8221;/&#62;</span></p>
<p style="padding-left:30px;"><span style="color:#3366ff;">&#60;/a&#62;&#60;/li&#62;</span></p>
<p style="padding-left:30px;"><span style="color:#3366ff;">&#60;/xsl:for-each&#62;</span></p>
<p style="padding-left:30px;"><span style="color:#3366ff;">&#60;/ul&#62;</span></p>
</blockquote>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Useful Umbraco Introduction for beginners]]></title>
<link>http://lifeisimple.wordpress.com/2009/10/21/useful-umbraco-introduction/</link>
<pubDate>Wed, 21 Oct 2009 08:22:00 +0000</pubDate>
<dc:creator>lifeisimple</dc:creator>
<guid>http://lifeisimple.wordpress.com/2009/10/21/useful-umbraco-introduction/</guid>
<description><![CDATA[This is indeed a very valuable article for beginners. (Which is surprisingly very difficult to find ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>This is indeed a very valuable article for beginners. (Which is surprisingly very difficult to find the resources for beginners)</p>
<p>Refer: <a href="http://umbracocms.blogspot.com/2009/08/quick-take-review-umbraco-web-content_14.html">http://umbracocms.blogspot.com/2009/08/quick-take-review-umbraco-web-content_14.html</a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Putting your ASP.NET Web Application in Maintenance Mode (using ISAPI_Rewrite)]]></title>
<link>http://blog.leekelleher.com/2009/09/29/putting-your-asp-net-web-application-in-maintenance-mode-using-isapi_rewrite/</link>
<pubDate>Tue, 29 Sep 2009 13:22:14 +0000</pubDate>
<dc:creator>Lee Kelleher</dc:creator>
<guid>http://blog.leekelleher.com/2009/09/29/putting-your-asp-net-web-application-in-maintenance-mode-using-isapi_rewrite/</guid>
<description><![CDATA[Prompted by @slace&#8217;s tweet: i wish there was a way to use app_offline but still view from cert]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Prompted by <a href="http://twitter.com/slace/status/4466099083">@slace&#8217;s tweet</a>:</p>
<blockquote><p><a href="http://twitter.com/slace/"><img src="http://a1.twimg.com/profile_images/304684998/me_bigger.png" alt="Aaron Powell" width="32" height="32" align="absmiddle" border="0" /></a> i wish there was a way to use app_offline but still view from certain ip&#8217;s</p></blockquote>
<p>I <a href="http://twitter.com/leekelleher/status/4466197573">replied</a> with a suggestion that we&#8217;ve used in the past. <a href="http://twitter.com/slace/status/4466254905">Aaron said I should blog about it&#8230;</a> so here I am (again)!</p>
<p>A while ago we needed to do an Umbraco upgrade (from v3 to v4) on a production server &#8211; in my opinion it was a pretty major upgrade on a live site, we had done a couple of test upgrades on dev and staging, all was successful.  But since there was various parts of the site that we need to regression test, I felt it best to take the entire site offline whilst we upgraded.</p>
<p>Usually creating an &#8220;<a href="http://weblogs.asp.net/scottgu/archive/2005/10/06/426755.aspx">App_Offline.htm</a>&#8221; page in the root of your web app is enough to take it offline.  However that was no good for testing&#8230; so what to do?</p>
<p>This is where <a href="http://www.helicontech.com/isapi_rewrite/">ISAPI_Rewrite</a> is your best friend, (or <a href="http://en.wikipedia.org/wiki/Htaccess">.htaccess</a> to be precise).  We needed to configure the site to allow access for us and redirect everyone else to a &#8220;Site under maintenance&#8221; page.  I found a few examples across the web, but to save you all that hassle, here are the .htaccess rules that we use:</p>
<pre class="brush: xml;"># BEGIN Maintanence Mode
&#60;IfModule mod_rewrite.c&#62;
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !/offline.html$
RewriteCond %{REMOTE_ADDR} !^82\.13\.23\.230$
RewriteRule ^(.*)$ /offline.html [R=302,L]
&#60;/IfModule&#62;
# END Maintanence Mode</pre>
<p>What does it do? The first &#8220;RewriteCond&#8221; rule checks that you are not requesting the &#8220;offline.html&#8221; page (otherwise you would end up in a constant loop!) The second &#8220;RewriteCond&#8221; checks the IP address of the visitor &#8211; in my case it was &#8220;82.13.23.230&#8243; (remember to escape the dots).  If those two rules aren&#8217;t satisfied, then the &#8220;RewriteRule&#8221; is used, redirecting the visitor to the &#8220;offline.html&#8221; page.</p>
<p>As always, I am open to any suggestions or improvements!</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Umbraco Force Redirect]]></title>
<link>http://cjgiddings.wordpress.com/2009/09/16/umbraco-force-redirect/</link>
<pubDate>Wed, 16 Sep 2009 04:00:58 +0000</pubDate>
<dc:creator>cjgiddings</dc:creator>
<guid>http://cjgiddings.wordpress.com/2009/09/16/umbraco-force-redirect/</guid>
<description><![CDATA[In Umbraco I had a need to force the user to be redirected to another page, the easiest way is to cr]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>In Umbraco I had a need to force the user to be redirected to another page, the easiest way is to create a asp.net control (macro) and put it on the template and there you go. But why this is expensive as it has to go all the way through the umbraco context which uses additional resources. So how do I get around this&#8230;.</p>
<p><!--more--><strong>Research</strong><br />
First i did a bit of research and found a redirect package but this just wasn&#8217;t what i wanted, so the next thing i did was look at the HttpModules that are found for Umbraco well what i found is that these modules do very little of the processing, and all the processing is actually handled on the page, to me this just seems like a silly idea but i guess the it&#8217;s got it&#8217;s reasons for this. I then used reflector to have a look at how the page is determined, security, etc.</p>
<p>What i found is that i can actually do most of this manually in a HttpModule but it also showed that what it could also do is allow a Pipeline of such for the HttpRequest to be created just like Sitecore (i have used Sitecore for a very very long time since 2002) and this approach is so easy for developers to tap into.</p>
<p><strong>Visual Studio</strong><br />
So how did I go about implementing this solution well firstly I opened up visual studio and my solution.</p>
<ol>
<li>Created a new class which i called &#8220;ForceRedirectModule&#8221;.</li>
<li>Register this class to the &#8220;IHttpModule&#8221; interface.
<ol>
<li>Make sure you implement the interface which will give you &#8220;Dispose&#8221; and &#8220;Int&#8221; methods for the class.</li>
</ol>
</li>
<li>In the &#8220;Init&#8221; method we want to register to the &#8220;HttpApplication&#8221; &#8220;AuthenticateRequest&#8221; event handler, and for this example I&#8217;ve used &#8220;ForceRedirect_AuthenticateRequest&#8221;.</li>
</ol>
<p>So once you&#8217;ve done that you class should look something like below:</p>
<div id="_mcePaste" style="left:-10000px;width:1px;position:absolute;top:0;height:1px;">public class ForceRedirectModule : IHttpModule</div>
<div id="_mcePaste" style="left:-10000px;width:1px;position:absolute;top:0;height:1px;">{</div>
<div id="_mcePaste" style="left:-10000px;width:1px;position:absolute;top:0;height:1px;">#region IHttpModule Members</div>
<div id="_mcePaste" style="left:-10000px;width:1px;position:absolute;top:0;height:1px;">public void Dispose()</div>
<div id="_mcePaste" style="left:-10000px;width:1px;position:absolute;top:0;height:1px;">{</div>
<div id="_mcePaste" style="left:-10000px;width:1px;position:absolute;top:0;height:1px;">//throw new NotImplementedException();</div>
<div id="_mcePaste" style="left:-10000px;width:1px;position:absolute;top:0;height:1px;">}</div>
<div id="_mcePaste" style="left:-10000px;width:1px;position:absolute;top:0;height:1px;">public void Init(HttpApplication context)</div>
<div id="_mcePaste" style="left:-10000px;width:1px;position:absolute;top:0;height:1px;">{</div>
<div id="_mcePaste" style="left:-10000px;width:1px;position:absolute;top:0;height:1px;">// we use AuthenticateRequest so we have access to the user</div>
<div id="_mcePaste" style="left:-10000px;width:1px;position:absolute;top:0;height:1px;">context.AuthenticateRequest += new EventHandler(ForceRedirect_AuthenticateRequest);</div>
<div id="_mcePaste" style="left:-10000px;width:1px;position:absolute;top:0;height:1px;">}</div>
<div id="_mcePaste" style="left:-10000px;width:1px;position:absolute;top:0;height:1px;">#endregion</div>
<div id="_mcePaste" style="left:-10000px;width:1px;position:absolute;top:0;height:1px;">void ForceRedirect_AuthenticateRequest(object sender, EventArgs e)</div>
<div id="_mcePaste" style="left:-10000px;width:1px;position:absolute;top:0;height:1px;">{</div>
<div id="_mcePaste" style="left:-10000px;width:1px;position:absolute;top:0;height:1px;">}</div>
<div id="_mcePaste" style="left:-10000px;width:1px;position:absolute;top:0;height:1px;">}</div>
<p>public class ForceRedirectModule : IHttpModule<br />
{<br />
    #region IHttpModule Members<br />
    public void Dispose()<br />
    {<br />
        //throw new NotImplementedException();<br />
    }</p>
<p>    public void Init(HttpApplication context)<br />
    {<br />
        // we use AuthenticateRequest so we have access to the user<br />
        context.AuthenticateRequest += new EventHandler(ForceRedirect_AuthenticateRequest);<br />
    }<br />
    #endregion</p>
<p>     void ForceRedirect_AuthenticateRequest(object sender, EventArgs e)<br />
     {<br />
         //throw new NotImplementedException();<br />
     }<br />
}</p>
<p>The reason why we have to register to the &#8220;AuthenicateRequest&#8221; instead of &#8220;BeginRequest&#8221; is that by the time BeginRequest fires the system has worked out if the user is valid or not, i personally don&#8217;t like this but it&#8217;s the only way to do this at the moment without re-writing the full front end (cough cough i might have already started doing).</p>
<p>Next what we&#8217;ll do is setup some local variables which we will use a bit later on:<br />
private HttpApplication httpApp;<br />
private const string ForceRedirect = &#8220;forceredirect&#8221;;<br />
private const string MemberForceRedirect = &#8220;memberforceredirect&#8221;;</p>
<p>We want to modify out Init code to be the following:<br />
public void Init(HttpApplication context)<br />
{<br />
    // we use AuthenticateRequest so we have access to the user<br />
    context.AuthenticateRequest += new EventHandler(ForceRedirect_AuthenticateRequest);<br />
    httpApp = context;<br />
}</p>
<p>What we are doing is just registring the context so we can use it later on for ease.</p>
<p>Next we want to create a private method called IsUrlValid which will be used to help filter out pages we don&#8217;t want to redirect on, this is crude but it work:<br />
private bool IsUrlValid(HttpContext context)<br />
{<br />
    string url = context.Request.Url.AbsoluteUri;</p>
<p>    // make sure it only uses if required<br />
    if ((url.IndexOf(&#8220;.aspx&#8221;) &#62; -1) &#38;&#38;<br />
    !context.Request.Url.AbsolutePath.StartsWith(&#8220;/umbraco/&#8221;) &#38;&#38;<br />
    !context.Request.Url.AbsolutePath.StartsWith(&#8220;/bin/&#8221;) &#38;&#38;<br />
    !context.Request.Url.AbsolutePath.StartsWith(&#8220;/umbraco_client/&#8221;) &#38;&#38;<br />
    !context.Request.Url.AbsolutePath.StartsWith(&#8220;/usercontrols/&#8221;) &#38;&#38;<br />
    !context.Request.Url.AbsolutePath.StartsWith(&#8220;/xslt/&#8221;) &#38;&#38;<br />
    !context.Request.Url.AbsolutePath.StartsWith(&#8220;/scripts/&#8221;) &#38;&#38;<br />
    !context.Request.Url.AbsolutePath.StartsWith(&#8220;/masterpages/&#8221;) &#38;&#38;<br />
    !context.Request.Url.AbsolutePath.StartsWith(&#8220;/install/&#8221;) &#38;&#38;<br />
    !context.Request.Url.AbsolutePath.StartsWith(&#8220;/umbraco_client/&#8221;) &#38;&#38;<br />
    !context.Request.Url.AbsolutePath.StartsWith(&#8220;/data/&#8221;) &#38;&#38;<br />
    !context.Request.Url.AbsolutePath.StartsWith(&#8220;/config/&#8221;)<br />
    )<br />
    {<br />
       return true;<br />
    }</p>
<p>    return false;<br />
}</p>
<p>Next we need to start adding some code to out ForceRedirect_AuthenticateRequest handler:<br />
void ForceRedirect_AuthenticateRequest(object sender, EventArgs e)<br />
{<br />
    HttpContext context = httpApp.Context;</p>
<p>    if (IsUrlValid(context))<br />
    {<br />
 string[] paths = context.Request.Url.AbsolutePath.Replace(&#8220;.aspx&#8221;, &#8220;&#8221;).Split(&#8216;/&#8217;);</p>
<p> // make sure we have data<br />
 if (paths.Length &#62; 0)<br />
 {<br />
     // build the dynamic path from the root<br />
     System.Text.StringBuilder sb = new System.Text.StringBuilder();</p>
<p>     // process the nodes<br />
     for (int i = 0; i &#60; paths.Length; i++)<br />
     {<br />
  if (!paths[i].Equals(string.Empty))<br />
  {<br />
      // make sure we have the first instance so it works correctly<br />
      if (sb.Length == 0)<br />
      {<br />
   sb.Append(&#8220;.&#8221;);<br />
      }</p>
<p>      sb.AppendFormat(&#8220;/node[@urlName='{0}']&#8220;, paths[i]);<br />
  }<br />
     }</p>
<p>     if (sb.Length &#62; 0)<br />
     {<br />
  string domainName = context.Request.ServerVariables["SERVER_NAME"];</p>
<p>  if (umbraco.cms.businesslogic.web.Domain.Exists(domainName))<br />
  {<br />
      System.Xml.XmlElement domain = umbraco.content.Instance.XmlContent.GetElementById(umbraco.cms.businesslogic.web.Domain.GetRootFromDomain(domainName).ToString());</p>
<p>      if (domain != null)<br />
      {<br />
   //string currentId = node.Attributes.GetNamedItem(&#8220;id&#8221;).Value;<br />
   System.Xml.XmlNode currentNode = domain.SelectSingleNode(sb.ToString());</p>
<p>   if (currentNode != null)<br />
   {<br />
       string redirectUrl = ForceRedirectCheck(currentNode, 0);</p>
<p>       if (!redirectUrl.Equals(string.Empty))<br />
       {<br />
    httpApp.Context.Response.Redirect(redirectUrl);<br />
       }<br />
   }<br />
      }<br />
  }<br />
     }<br />
 }<br />
    }<br />
}</p>
<p>Now what does this do, it&#8217;s quite simple it gets the current page and finds the node for this, it then doesn&#8217;t some checks to see if everything is fine, the bulk of the additional processing is done in the ForceRedirectCheck method.<br />
The ForceRedirectCheck method makes sure that the page firstly has the fields required, if not it does nothing, but if they are found and not empty then it starts processing the calling page to try and see if that page requires a redirect, this will continue until it finds a page which doesn&#8217;t redirect, yes it means you could put this into a circular dependency, but you know what that would be your own stupid fault.<br />
Below is the code for the ForceRedirectCheck:<br />
private string ForceRedirectCheck(System.Xml.XmlNode currentNode, int loop)<br />
{<br />
    System.Xml.XmlNode forceRedirect = null;<br />
    string returnData = &#8220;&#8221;;</p>
<p>    // try member force redirect first<br />
    if (httpApp.Context.User != null &#38;&#38; httpApp.Context.User.Identity.IsAuthenticated)<br />
    {<br />
 forceRedirect = currentNode.SelectSingleNode(&#8220;./data [@alias = '" + MemberForceRedirect + "']&#8220;);<br />
    }</p>
<p>    if (forceRedirect == null &#124;&#124; forceRedirect.ChildNodes.Count &#60;= 0)<br />
    {<br />
 forceRedirect = currentNode.SelectSingleNode(&#8220;./data [@alias = '" + ForceRedirect + "']&#8220;);<br />
    }</p>
<p>    if (forceRedirect != null &#38;&#38; forceRedirect.ChildNodes.Count &#62; 0)<br />
    {<br />
 int redirectId = 0;<br />
 if (int.TryParse(forceRedirect.ChildNodes[0].Value, out redirectId))<br />
 {<br />
     returnData = ForceRedirectCheck(umbraco.content.Instance.XmlContent.GetElementById(redirectId.ToString()), loop + 1);<br />
 }<br />
    }</p>
<p>    if (returnData.Equals(string.Empty) &#38;&#38; loop &#62; 0)<br />
    {<br />
 returnData = umbraco.library.NiceUrl(Convert.ToInt32(currentNode.Attributes["id"].Value));<br />
    }</p>
<p>    return returnData;<br />
}</p>
<p>That&#8217;s all the code, so here is what you should have:</p>
<p>using System;<br />
using System.Collections.Generic;<br />
using System.Linq;<br />
using System.Web;</p>
<p>namespace TestProject<br />
{<br />
    public class ForceRedirectModule : IHttpModule<br />
    {<br />
        private HttpApplication httpApp;<br />
        private const string ForceRedirect = &#8220;forceredirect&#8221;;<br />
        private const string MemberForceRedirect = &#8220;memberforceredirect&#8221;;</p>
<p>        #region IHttpModule Members</p>
<p>        public void Dispose()<br />
        {<br />
            //throw new NotImplementedException();<br />
        }</p>
<p>        public void Init(HttpApplication context)<br />
        {<br />
            // we use AuthenticateRequest so we have access to the user<br />
            context.AuthenticateRequest += new EventHandler(ForceRedirect_AuthenticateRequest);<br />
            httpApp = context;<br />
        }</p>
<p>        #region IsUrlValid<br />
        private bool IsUrlValid(HttpContext context)<br />
        {<br />
            string url = context.Request.Url.AbsoluteUri;</p>
<p>            // make sure it only uses if required<br />
            if ((url.IndexOf(&#8220;.aspx&#8221;) &#62; -1) &#38;&#38;<br />
                !context.Request.Url.AbsolutePath.StartsWith(&#8220;/umbraco/&#8221;) &#38;&#38;<br />
                !context.Request.Url.AbsolutePath.StartsWith(&#8220;/bin/&#8221;) &#38;&#38;<br />
                !context.Request.Url.AbsolutePath.StartsWith(&#8220;/umbraco_client/&#8221;) &#38;&#38;<br />
                !context.Request.Url.AbsolutePath.StartsWith(&#8220;/usercontrols/&#8221;) &#38;&#38;<br />
                !context.Request.Url.AbsolutePath.StartsWith(&#8220;/xslt/&#8221;) &#38;&#38;<br />
                !context.Request.Url.AbsolutePath.StartsWith(&#8220;/scripts/&#8221;) &#38;&#38;<br />
                !context.Request.Url.AbsolutePath.StartsWith(&#8220;/masterpages/&#8221;) &#38;&#38;<br />
                !context.Request.Url.AbsolutePath.StartsWith(&#8220;/install/&#8221;) &#38;&#38;<br />
                !context.Request.Url.AbsolutePath.StartsWith(&#8220;/umbraco_client/&#8221;) &#38;&#38;<br />
                !context.Request.Url.AbsolutePath.StartsWith(&#8220;/data/&#8221;) &#38;&#38;<br />
                !context.Request.Url.AbsolutePath.StartsWith(&#8220;/config/&#8221;)<br />
                )<br />
            {<br />
                return true;<br />
            }</p>
<p>            return false;<br />
        }<br />
        #endregion</p>
<p>        void ForceRedirect_AuthenticateRequest(object sender, EventArgs e)<br />
        {<br />
            HttpContext context = httpApp.Context;<br />
           <br />
            if (IsUrlValid(context))<br />
            {<br />
                string[] paths = context.Request.Url.AbsolutePath.Replace(&#8220;.aspx&#8221;, &#8220;&#8221;).Split(&#8216;/&#8217;);</p>
<p>                // make sure we have data<br />
                if (paths.Length &#62; 0)<br />
                {<br />
                    // build the dynamic path from the root<br />
                    System.Text.StringBuilder sb = new System.Text.StringBuilder();</p>
<p>                    // process the nodes<br />
                    for (int i = 0; i &#60; paths.Length; i++)<br />
                    {<br />
                        if (!paths[i].Equals(string.Empty))<br />
                        {<br />
                            // make sure we have the first instance so it works correctly<br />
                            if (sb.Length == 0)<br />
                            {<br />
                                sb.Append(&#8220;.&#8221;);<br />
                            }</p>
<p>                            sb.AppendFormat(&#8220;/node[@urlName='{0}']&#8220;, paths[i]);<br />
                        }<br />
                    }</p>
<p>                    if (sb.Length &#62; 0)<br />
                    {<br />
                        string domainName = context.Request.ServerVariables["SERVER_NAME"];</p>
<p>                        if (umbraco.cms.businesslogic.web.Domain.Exists(domainName))<br />
                        {<br />
                            System.Xml.XmlElement domain = umbraco.content.Instance.XmlContent.GetElementById(umbraco.cms.businesslogic.web.Domain.GetRootFromDomain(domainName).ToString());</p>
<p>                            if (domain != null)<br />
                            {<br />
                                //string currentId = node.Attributes.GetNamedItem(&#8220;id&#8221;).Value;<br />
                                System.Xml.XmlNode currentNode = domain.SelectSingleNode(sb.ToString());</p>
<p>                                if (currentNode != null)<br />
                                {<br />
                                    string redirectUrl = ForceRedirectCheck(currentNode, 0);</p>
<p>                                    if (!redirectUrl.Equals(string.Empty))<br />
                                    {<br />
                                        httpApp.Context.Response.Redirect(redirectUrl);<br />
                                    }<br />
                                }<br />
                            }<br />
                        }<br />
                    }<br />
                }<br />
            }<br />
        }</p>
<p>        #endregion</p>
<p>        #region ForceRedirectCheck<br />
        private string ForceRedirectCheck(System.Xml.XmlNode currentNode, int loop)<br />
        {<br />
            System.Xml.XmlNode forceRedirect = null;<br />
            string returnData = &#8220;&#8221;;</p>
<p>            // try member force redirect first<br />
            if (httpApp.Context.User != null &#38;&#38; httpApp.Context.User.Identity.IsAuthenticated)<br />
            {<br />
                forceRedirect = currentNode.SelectSingleNode(&#8220;./data [@alias = '" + MemberForceRedirect + "']&#8220;);<br />
            }</p>
<p>            if (forceRedirect == null &#124;&#124; forceRedirect.ChildNodes.Count &#60;= 0)<br />
            {<br />
                forceRedirect = currentNode.SelectSingleNode(&#8220;./data [@alias = '" + ForceRedirect + "']&#8220;);<br />
            }</p>
<p>            if (forceRedirect != null &#38;&#38; forceRedirect.ChildNodes.Count &#62; 0)<br />
            {<br />
                int redirectId = 0;<br />
                if (int.TryParse(forceRedirect.ChildNodes[0].Value, out redirectId))<br />
                {<br />
                    returnData = ForceRedirectCheck(umbraco.content.Instance.XmlContent.GetElementById(redirectId.ToString()), loop + 1);<br />
                }<br />
            }</p>
<p>            if (returnData.Equals(string.Empty) &#38;&#38; loop &#62; 0)<br />
            {<br />
                returnData = umbraco.library.NiceUrl(Convert.ToInt32(currentNode.Attributes["id"].Value));<br />
            }</p>
<p>            return returnData;<br />
        }<br />
        #endregion<br />
    }<br />
}</p>
<p>Web.Config<br />
The code has been done and compiled fine, to use this you have to place the http module in the correct location.<br />
Open up the web.config file and drill down to the httpModule section and add this in the following location:</p>
<p>&#60;httpModules&#62;<br />
   &#60;!&#8211; URL REWRTIER &#8211;&#62;<br />
   &#60;add name=&#8221;UrlRewriteModule&#8221; type=&#8221;UrlRewritingNet.Web.UrlRewriteModule, UrlRewritingNet.UrlRewriter&#8221; /&#62;<br />
   &#60;add name=&#8221;umbracoRequestModule&#8221; type=&#8221;umbraco.presentation.requestModule&#8221; /&#62;<br />
   &#60;!&#8211; UMBRACO &#8211;&#62;<br />
   &#60;add name=&#8221;viewstateMoverModule&#8221; type=&#8221;umbraco.presentation.viewstateMoverModule&#8221; /&#62;<br />
   &#60;add name=&#8221;umbracoBaseRequestModule&#8221; type=&#8221;umbraco.presentation.umbracobase.requestModule&#8221; /&#62;<br />
<strong>   &#60;!&#8211; FORCE REDIRECT &#8211;&#62;<br />
   &#60;add name=&#8221;forceRedirectModule&#8221; type=&#8221;TestProject.ForceRedirectModule, TestProject&#8221; /&#62;</strong><br />
   &#60;!&#8211; ASPNETAJAX &#8211;&#62;<br />
   &#60;add name=&#8221;ScriptModule&#8221; type=&#8221;System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&#8243;/&#62;<br />
&#60;/httpModules&#62;</p>
<p><strong>Umbraco</strong><br />
Now that the code has been finished we have to update umbraco so we can use it, simply go to the required document type and add the following fields:</p>
<ul>
<li>&#8220;forceredirect&#8221;: link</li>
<li>&#8220;memberforceredirect&#8221;: link</li>
</ul>
<p>That&#8217;s it just save the doc type and update the required node and publish.<br />
Now when your a public user and you hit the page you will be redirected to where ever, and if your a member and hit the page you can also be redirected to a different locaiton agian.</p>
<p><strong>Conclusion<br />
</strong>As you can see it wasn&#8217;t to difficult to create a http module but in the end it should of been a lot easier, but now it saves the resources that would be handled by the page and the redirecting occurs with out any hassels.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[My Own Domain, Own Blog Design and Own Feelings]]></title>
<link>http://hercolorfulstories.com/2009/09/12/own-domain-blog-design-feelings/</link>
<pubDate>Sat, 12 Sep 2009 10:08:21 +0000</pubDate>
<dc:creator>Carol</dc:creator>
<guid>http://hercolorfulstories.com/2009/09/12/own-domain-blog-design-feelings/</guid>
<description><![CDATA[I backordered colorfulstories.com from GoDaddy.com today. Hope it will be successful! I have lots of]]></description>
<content:encoded><![CDATA[I backordered colorfulstories.com from GoDaddy.com today. Hope it will be successful! I have lots of]]></content:encoded>
</item>
<item>
<title><![CDATA[Umbraco: Ultimate Picker XSLT Example]]></title>
<link>http://blog.leekelleher.com/2009/09/08/umbraco-ultimate-picker-xslt-example/</link>
<pubDate>Tue, 08 Sep 2009 22:38:14 +0000</pubDate>
<dc:creator>Lee Kelleher</dc:creator>
<guid>http://blog.leekelleher.com/2009/09/08/umbraco-ultimate-picker-xslt-example/</guid>
<description><![CDATA[Chatting with Dan (my partner-in-code at Bodenko) about the Ultimate Picker data-type in Umbraco, we]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Chatting with Dan (my partner-in-code at <a href="http://bodenko.com/">Bodenko</a>) about the Ultimate Picker data-type in Umbraco, we realised that we couldn&#8217;t find any examples of how to use the data in XSLT.  So obviously needing an excuse to write-up a new blog post, here we go.</p>
<p>If you need a quick overview about the Ultimate Picker data-type, see <a href="http://www.nibble.be/?p=38">Tim Geyssens&#8217; blog post</a>.</p>
<p>For my example, using a default Umbraco install (with Runway), we will create a new data-type using the Ultimate Picker, (let&#8217;s call it &#8220;<em>Runway Textpage Picker</em>&#8220;), we select the &#8216;<strong>Database datatype</strong>&#8216; to be &#8220;Nvarchar&#8221;; the &#8216;<strong>Type</strong>&#8216; as a &#8220;List Box&#8221;; The &#8216;<strong>Parent nodeid</strong>&#8216; is &#8220;1048&#8243; and the &#8216;<strong>Document Alias</strong>&#8216; filter is &#8220;RunwayTextpage&#8221; &#8211; we also tick the &#8216;<strong>Show grandchildren</strong>&#8216; checkbox.</p>
<div id="attachment_158" class="wp-caption aligncenter" style="width: 160px"><a href="http://leekelleher.wordpress.com/files/2009/09/ultimatepicker-datatype.png"><img class="size-thumbnail wp-image-158 " title="UltimatePicker-DataType" src="http://leekelleher.wordpress.com/files/2009/09/ultimatepicker-datatype.png?w=150" alt="Ultimate Picker Data Type settings" width="150" height="112" /></a><p class="wp-caption-text">Ultimate Picker Data Type settings</p></div>
<p>Next, we will assign the new &#8220;<em>Runway Textpage Picker</em>&#8220; data-type to a property of the Runway Textpage, we will call it &#8220;<em>Related Content</em>&#8220;. For more information about working with document types, please refer to the our.umbraco.org wiki page, (<a href="http://our.umbraco.org/wiki/how-tos/working-with-document-types">Working with document types</a>).</p>
<div id="attachment_160" class="wp-caption aligncenter" style="width: 160px"><a href="http://leekelleher.wordpress.com/files/2009/09/ultimatepicker-doctype.png"><img class="size-thumbnail wp-image-160 " title="UltimatePicker-DocType" src="http://leekelleher.wordpress.com/files/2009/09/ultimatepicker-doctype.png?w=150" alt="Adding Ultimate Picker to a Document Type" width="150" height="112" /></a><p class="wp-caption-text">Adding Ultimate Picker to a Document Type</p></div>
<p>Once the document-type is saved, we move on to the &#8216;<strong>Content</strong>&#8216; section. Select any of the Runway Textpages.  You should now see the &#8216;<em>Related Content</em>&#8216; property panel, containing a list of all the other Runway Textpages.  To select multiple items, hold-down the CTRL (or Command on the Mac) button.  When you have finished, click the &#8217;<strong>Save and publish</strong>&#8216; button.</p>
<div id="attachment_162" class="wp-caption aligncenter" style="width: 160px"><a href="http://leekelleher.wordpress.com/files/2009/09/ultimatepicker-relatedcontent.png"><img class="size-thumbnail wp-image-162" title="UltimatePicker-RelatedContent" src="http://leekelleher.wordpress.com/files/2009/09/ultimatepicker-relatedcontent.png?w=150" alt="Selecting related content" width="150" height="112" /></a><p class="wp-caption-text">Selecting related content</p></div>
<p>For the next part we get to the real meat of this blog post&#8230; the XSLT!</p>
<div id="attachment_163" class="wp-caption aligncenter" style="width: 160px"><a href="http://leekelleher.wordpress.com/files/2009/09/ultimatepicker-createmacro.png"><img class="size-thumbnail wp-image-163 " title="UltimatePicker-CreateMacro" src="http://leekelleher.wordpress.com/files/2009/09/ultimatepicker-createmacro.png?w=150" alt="Create a new XSLT" width="150" height="112" /></a><p class="wp-caption-text">Create a new XSLT</p></div>
<p>Create a new XSLT called &#8220;<em>RelatedContent</em>&#8221; (without the .xslt extension), keep it &#8216;Clean&#8217; and tick the &#8216;<strong>Create Macro</strong>&#8216; checkbox.  Next a quick short-cut for you; copy-n-paste the following XSLT into the main editor window.</p>
<div id="attachment_164" class="wp-caption aligncenter" style="width: 160px"><a href="http://leekelleher.wordpress.com/files/2009/09/ultimatepicker-xslt.png"><img class="size-thumbnail wp-image-164" title="UltimatePicker-XSLT" src="http://leekelleher.wordpress.com/files/2009/09/ultimatepicker-xslt.png?w=150" alt="Copy-n-paste the XSLT" width="150" height="112" /></a><p class="wp-caption-text">Copy-n-paste the XSLT</p></div>
<pre class="brush: xml;">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;!DOCTYPE xsl:stylesheet [ &lt;!ENTITY nbsp &quot;&amp;#xA0;&quot;&gt; ]&gt;
&lt;xsl:stylesheet
	version=&quot;1.0&quot;
	xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
	xmlns:msxml=&quot;urn:schemas-microsoft-com:xslt&quot;
	xmlns:umbraco.library=&quot;urn:umbraco.library&quot;
	exclude-result-prefixes=&quot;msxml umbraco.library&quot;&gt;
	&lt;xsl:output method=&quot;xml&quot; omit-xml-declaration=&quot;yes&quot;/&gt;

	&lt;xsl:param name=&quot;currentPage&quot;/&gt;

	&lt;xsl:template match=&quot;/&quot;&gt;
		&lt;xsl:variable name=&quot;preNodes&quot;&gt;
					&lt;xsl:variable name=&quot;relatedContent&quot; select=&quot;$currentPage/data[@alias='RelatedContent']&quot; /&gt;
					&lt;xsl:variable name=&quot;nodeIds&quot; select=&quot;umbraco.library:Split($relatedContent, ',')&quot; /&gt;
					&lt;xsl:for-each select=&quot;$nodeIds/value&quot;&gt;
						&lt;xsl:copy-of select=&quot;umbraco.library:GetXmlNodeById(.)&quot;/&gt;
					&lt;/xsl:for-each&gt;
		&lt;/xsl:variable&gt;
		&lt;xsl:variable name=&quot;nodes&quot; select=&quot;msxml:node-set($preNodes)/node&quot; /&gt;
		&lt;xsl:if test=&quot;count($nodes) &gt; 0&quot;&gt;
&lt;div class=&quot;related-content&quot;&gt;
&lt;h3&gt;Related Content&lt;/h3&gt;
&lt;ul&gt;
					&lt;xsl:for-each select=&quot;$nodes&quot;&gt;
	&lt;li&gt;
							&lt;a href=&quot;{umbraco.library:NiceUrl(@id)}&quot;&gt;
								&lt;xsl:value-of select=&quot;@nodeName&quot; /&gt;
							&lt;/a&gt;&lt;/li&gt;
&lt;/xsl:for-each&gt;&lt;/ul&gt;
&lt;/div&gt;
&lt;/xsl:if&gt;
	&lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;</pre>
<p>Here&#8217;s a quick explanation of what is happening in the XSLT.  We are provided with a list of comma-separated nodeIds from the Ultimate Picker, which we need to parse/split &#8211; then pull back the XML node data, then we can transform it however we like!</p>
<p>The way we do this is 2-tiered, first we must loop through the comma-separated list, pulling back the XML node for each nodeId, adding it to an XSLT variable.  Doing this will cause the XSLT variable to be a fragmented node-tree, which means that we need to convert the node-tree fragment into a node-set.  (*Note: there are a gazillion ways to skin a cat &#8211; suggestions are welcome &#8211; this method works for me).</p>
<p>Once we have the complete XML node-set, we can transform into whatever HTML we  like.</p>
<p>Now that we are done with the XSLT, we can edit our template in the &#8216;<strong>Settings</strong>&#8216; section. Select the &#8220;<em>Runway Textpage</em>&#8221; template. Somewhere after the &#8216;<em>bodyText</em>&#8216; property item, click on the &#8216;Insert Macro&#8217; button.  From the &#8216;<strong>Choose a macro</strong>&#8216; drop-down, select the &#8216;<em>Related Content</em>&#8216; option &#8211; this will add the macro code to the template.</p>
<div id="attachment_167" class="wp-caption aligncenter" style="width: 160px"><a href="http://leekelleher.wordpress.com/files/2009/09/ultimatepicker-template.png"><img class="size-thumbnail wp-image-167" title="UltimatePicker-Template" src="http://leekelleher.wordpress.com/files/2009/09/ultimatepicker-template.png?w=150" alt="Insert the macro into the template" width="150" height="112" /></a><p class="wp-caption-text">Insert the macro into the template</p></div>
<p>Save the template and view the front-end page. We can now see the <em>Related Content</em> pages. Tada!</p>
<div id="attachment_168" class="wp-caption aligncenter" style="width: 310px"><a href="http://leekelleher.wordpress.com/files/2009/09/ultimatepicker-frontend.png"><img class="size-medium wp-image-168" title="UltimatePicker-FrontEnd" src="http://leekelleher.wordpress.com/files/2009/09/ultimatepicker-frontend.png?w=300" alt="The end result! Related Content" width="300" height="225" /></a><p class="wp-caption-text">The end result! Related Content</p></div>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Do you feel obligated to open source your Umbraco package?]]></title>
<link>http://blog.sitereactor.dk/2009/08/27/do-you-feel-obligated-to-open-source-your-umbraco-package/</link>
<pubDate>Thu, 27 Aug 2009 20:10:28 +0000</pubDate>
<dc:creator>Morten Christensen</dc:creator>
<guid>http://blog.sitereactor.dk/2009/08/27/do-you-feel-obligated-to-open-source-your-umbraco-package/</guid>
<description><![CDATA[I have been thinking about this subject for some time now, but todays tweets got me thinking and I t]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>I have been thinking about this subject for some time now, but todays tweets got me thinking and I thought I&#8217;d write up a post to <strong>hopefully stir up some discussion</strong>.</p>
<p>Maybe I should start off by saying that i&#8217;m not a money hungry developer, but I think that we can all agree that even though we are working with an open source CMS, we have to make money some how some way. Of course we get paid when developing a customer solution, but it seems to me that things are a bit different when developing addons, plugins, packages, datatypes and everything else that has been developed by and for the Umbraco community.</p>
<p>Currently there are two packages available for purchase in the Umbraco store, and I counted 68 packages on our.umbraco.org today.<br />
Don&#8217;t get me wrong, I love the fact that so many people are contributing with a lot of great stuff that is free to install and use. I personally used <strong>Warren</strong>&#8217;s <strong>CWS</strong> package to get up to speed on Umbraco v.4 after not having used Umbraco since v.3.0.3. I think it is a great resource, but I probably wouldn&#8217;t have bought it if it was only available for purchase in the Umbraco store. No offense Warren <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>I myself started a pretty big project (at least for a spare time project) by developing Google Analytics for Umbraco, which is open sourced and thus free for all <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I thought about different models for getting a bit of return on creating a fairly large project, but ultimately decided that it should be open sourced. Partly because Google Analytics is already free to use, so it seem to be the best incentive to make the Umbraco package free as well &#8211; even though it might have greater value for some. Another part of the decision has to do with installbase and getting the package out there &#8211; won&#8217;t go into details, but sometimes its just nice to share your shit.<br />
<a title="Axendo website" href="http://www.axendo.nl" target="_blank">Axendo</a>, who have also created an Analytics plugin for Umbraco, have chosen to make a limited free version and a paid version, which I think is a cleaver thing to do. I hope the good guys at <strong>Axendo</strong> are not pissed of by me making my package open source and free, but hopefully they&#8217;ll still be able to sell their package, and they could actually use my source in their product should they want to do so in the future.<br />
I would personally find it cool if someone would want to adopt my Google Analytics for Umbraco package, and I would encourage all Solution Providers and Developers to make some money on implementing the Google Analytics section in customer solutions. In my latest offer to a new client I included a couple of packages from our.umbraco.org, which I think will be a win win situation for all: the client will get some very useful tools (free) and we (the solution provider) got some extra hours in on implementation.</p>
<p>Making a package free, open source or paid is ultimately up to the developer. One might think that because the CMS is free so should the addons. Well, not necessarily! Take a great addon like <strong>uCommerce</strong> which will definatly not be free, this product has a clear incentive for customers to buy it. I won&#8217;t go into details about uCommerce but I would love to hear <strong>Søren</strong>&#8217;s thoughts on selling an addon for an open source CMS <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Over the next six month I will be developing a couple of addons for Umbraco (got the ideas, just need the time), which will all be open source and made in my spare time. The main reason for these addons being open source is that the counter part or the part that will be integrated with Umbraco is also open source. I&#8217;m also hoping that the fact that the addons are free to install will help them spread and thus create a greater installbase. This could of course also be done with a limited free version and a paid full version, but I&#8217;m somehow not entirely sure that would work for the addons in question.<br />
So how do I get paid for spending a lot of spare time creating great addons? Should I get paid? Isn&#8217;t the gift of giving enough? <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /><br />
Well, a sponsor-an-umbraco-dev program would be great but I don&#8217;t know who would actually sponsor my work, so maybe selling support/upgrades/feature request implementations would be a better solution?</p>
<p>I personally think that when the good guys at Umbraco start selling the Forms module, it will make it easier for other developers to sell their packages, addons, plugins or whatever. Would also love to hear <strong>Niels</strong>&#8216; thoughts on this &#8211; do you think that <strong>Umbraco Corp.</strong> in a sense will lead the pack and in some way encourage customers/users to pay for addons?<br />
When a customer sees what great stuff he can get for a reasonable amount of money he probably won&#8217;t have a problem paying for it even though he &#8220;bought&#8221; an open source CMS in the first place, right?</p>
<p>So what do you think? Do you feel obligated to open source your Umbraco package or simply make it available for free? Are all the packages on our.umbraco.org not worth paying for? Are you hoping that all packages for Umbraco will always be free to install and use?</p>
<p>Please share your thoughts, as I would love to hear what others think about this subject.</p>
<p><strong>Darren Ferguson</strong>, you are one of the few people with packages in the store. What are your thoughts?</p>
<p><strong>Tommy Poulsen</strong>, you are making a great addon with the PDF creator. Do you intend to sell this addon or contribute it as a free to use package on our.umbraco.org and why?</p>
<p>Other package developers: Do you ultimately feel it depends on the content/usability of the package whether it should be free or paid?</p>
<p>I hope I didn&#8217;t make this post too much about money, but rather what makes developers or solution providers choose to make an Umbraco package free, paid or open source and how they get compensated for their work (via implementation for example?).</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Google map geocoding for the UK]]></title>
<link>http://ismailmayat.wordpress.com/2009/08/21/google-map-geocoding-for-the-uk/</link>
<pubDate>Fri, 21 Aug 2009 15:23:19 +0000</pubDate>
<dc:creator>ismailmayat</dc:creator>
<guid>http://ismailmayat.wordpress.com/2009/08/21/google-map-geocoding-for-the-uk/</guid>
<description><![CDATA[Those of you based in the UK who have created Googlemap mash ups in your umbraco sites or any other ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Those of you based in the UK who have created Googlemap mash ups in your umbraco sites or any other site for that matter, may have come across geo coding issues for UK post codes.  In some instances they can be out by quite a bit.  The actual google website is accurate however doing a look up via the api sometimes is not.  Its all to do with Royal mail licensing. Anyhow there is a hack and it works see <a href="http://www.tomanthony.co.uk/blog/geocoding-uk-postcodes-with-google-map-api/" target="_blank">here</a>.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[How to add style sheet items in menu? (TinyMCE)]]></title>
<link>http://developerssolutions.wordpress.com/2009/08/07/how-to-add-style-sheet-items-in-menu-tinymce/</link>
<pubDate>Fri, 07 Aug 2009 09:50:49 +0000</pubDate>
<dc:creator>developerssolutions</dc:creator>
<guid>http://developerssolutions.wordpress.com/2009/08/07/how-to-add-style-sheet-items-in-menu-tinymce/</guid>
<description><![CDATA[What I would reccommend is this set of steps: 1. One the Settings Tab, under &#8220;Stylesheets]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>What I would reccommend is this set of steps:</p>
<p>1. One the Settings Tab, under &#8220;Stylesheets&#8221;, create a style sheet to hold the styles you want available in the WYSIWYG RT editor &#8220;styles&#8221; menu. Let&#8217;s call it &#8220;Text Styles&#8221;.</p>
<p>2. Paste all the style code for those styles in this sheet, to keep them all in one place.</p>
<p>3. Update your &#8220;Templates&#8221; to add a reference to this new stylesheet in the HEAD sections.</p>
<p>4. On the Developer Tab, locate the &#8220;Richtext editor&#8221; under &#8220;Data Types&#8221;. Where it says &#8220;Related stylesheets:&#8221;, chedck the box next to &#8220;Text Styles&#8221;</p>
<p>Next, follow these steps to create the drop-down entry for each of the styles you want to be available for your editors to select:</p>
<p>1. Right-click on the &#8220;Text Styles&#8221; sheet and click &#8220;Create&#8221;.</p>
<p>2. Type the name you want displayed to users in the drop-down (example: &#8220;Subheading&#8221;), click the Create button.</p>
<p>3. For &#8220;Alias&#8221; type in the name of the style as it appears in your CSS (example: &#8220;h2&#8243; or &#8220;.subheading).</p>
<p>4. For &#8220;Styles:&#8221; put in the CSS code to change the display of that text as it will appear to the editor in the WYSIWYG RTE. example:<br />
font-weight: bold;<br />
font-size: 110%;</p>
<p>5. Save the new style.</p>
<p>Repeat these steps for each of the styles you want in the drop-down.</p>
<p>~ Luv</p>
<p>Jigar</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Robots.txt Editor for Umbraco]]></title>
<link>http://blog.leekelleher.com/2009/07/20/robots-txt-editor-for-umbraco/</link>
<pubDate>Mon, 20 Jul 2009 22:18:23 +0000</pubDate>
<dc:creator>Lee Kelleher</dc:creator>
<guid>http://blog.leekelleher.com/2009/07/20/robots-txt-editor-for-umbraco/</guid>
<description><![CDATA[Following up on my recent post of using Robots.txt with Umbraco, I decided that it would be nice to ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Following up on my recent post of using <a href="http://blog.leekelleher.com/2009/07/07/robots-txt-for-use-with-umbraco/">Robots.txt with Umbraco</a>, I decided that it would be nice to be able to edit the robots.txt directly from the Umbraco back-end.  (Also I wanted to play a bit more with the BaseTree/ITree classes).</p>
<p>This afternoon I had a few hours to spare &#8211; actually I was procrastinating on another job, (don&#8217;t tell my client &#8211; I&#8217;ll finish it off later tonight) &#8211; so I got down to some coding.</p>
<p>The <a href="http://umbracoext.codeplex.com/SourceControl/changeset/view/35482">source-code is available</a> on the <a href="http://umbracoext.codeplex.com/">Umbraco Extensions project</a> (on CodePlex) and created <a href="http://our.umbraco.org/projects/robotstxt-editor">a project page</a> on the new <a href="http://our.umbraco.org/">Our Umbraco community</a> website. (Don&#8217;t forget to give it some karma points! ;-p)</p>
<p><a href="http://our.umbraco.org/media/wiki/5402/633837309506210000_Robotstxt_Editor_10.zip">A direct download to the package installer (zip) is available here.</a></p>
<p>Very special thanks to <a href="http://webdeveloper2.com/">Dave Kinsella</a> for providing the <a href="http://twitpic.com/b01nb">Robot icon</a> <img class="alignnone size-full wp-image-149" title="robot icon" src="http://leekelleher.wordpress.com/files/2009/07/18477911.png" alt="robot icon" width="16" height="16" /> &#8211; although I know Dave, it was great <a href="http://twitter.com/leekelleher/statuses/2738891885">proof that Twitter really does work!</a> (Thanks to <a href="http://twitter.com/DanielBowden">Dan</a> too for his <a href="http://twitpic.com/b03gf">Johnny 5</a> attempt! <img class="alignnone size-full wp-image-150" title="18480255" src="http://leekelleher.wordpress.com/files/2009/07/18480255.png" alt="18480255" width="16" height="15" /> &#8211; Here was <a href="http://twitpic.com/b06dk">my attempt</a> too!  <img class="alignnone size-full wp-image-151" title="18484040" src="http://leekelleher.wordpress.com/files/2009/07/18484040.png" alt="18484040" width="16" height="16" />)</p>
<p>If you have any bugs, comments, feedback or suggestions – please feel free to get in touch with me via the <a href="http://our.umbraco.org/projects/robotstxt-editor/feedback">Our Umbraco forums</a>.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Add YouTube Plug-in to Umbraco/TinyMCE]]></title>
<link>http://blog.leekelleher.com/2009/07/16/add-youtube-plugin-to-umbraco-tinymce/</link>
<pubDate>Thu, 16 Jul 2009 15:07:25 +0000</pubDate>
<dc:creator>Lee Kelleher</dc:creator>
<guid>http://blog.leekelleher.com/2009/07/16/add-youtube-plugin-to-umbraco-tinymce/</guid>
<description><![CDATA[Update: Following on from Dirk and Ismail&#8217;s comments, I found out that this YouTube plug-in do]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><strong><span style="text-decoration:underline;"><em>Update:</em></span></strong><em> Following on from <a href="#comment-224">Dirk and Ismail&#8217;s comments</a>, I found out that this YouTube plug-in does not work with TinyMCE v3 (which is the default richtext editor in Umbraco v4). This guide is written to works  for Umbraco v3 <strong>only</strong>, (using TinyMCE v2).</em></p>
<p><em>If you are looking for similar functionality in Umbraco v4, (TinyMCE v3), then all you need to do is enable the &#8216;Flash/media&#8217; button in your Richtext editor data-type and embed the YouTube video like any other Flash movie (swf) &#8211; <a href="#comment-225">more details in my comment below</a>.</em></p>
<p><em><strong><span style="text-decoration:underline;">/End of update.</span></strong></em></p>
<hr />
Recently one of my clients wanted the ability to insert YouTube video clips directly into the TinyMCE editor within Umbraco.  My initial thought was to create a macro that would take a YouTube video URL, parse it and display it on the rendered (front-end) page.  <a href="http://www.nibble.be/?p=36">Tim G has a blog post on how to do this on his Nibble blog</a>, (love the <a href="http://www.youtube.com/watch?v=fruHQhNe-UM">Surfin&#8217; Bird</a> reference).</p>
<p>This approached worked fine, but we ran into problems trying to edit the YouTube video URL, along with that, my client had an additional step of selecting a macro, then entering the YouTube URL.</p>
<p>After a little researching, I eventually found a native <a href="http://sourceforge.net/tracker/index.php?func=detail&#38;aid=1669296&#38;group_id=103281&#38;atid=738747">YouTube plug-in for TinyMCE</a>, (<a href="http://sourceforge.net/tracker/download.php?group_id=103281&#38;atid=738747&#38;file_id=217845&#38;aid=1669296">direct link to ZIP download</a>).</p>
<p>Here is how I integrated in Umbraco:</p>
<ol>
<li>Extract the contents of the <code>youtube.zip</code> archive to your <code>/umbraco_client/tinymce/plugins/youtube/</code></li>
<li>In your <code>/config/</code> folder, open the <code>tinyMceConfig.config</code> file.</li>
<li>Insert the following lines:<br />
After the last <code>&#60;command /&#62;</code> entry, add&#8230;
<pre class="brush: xml;">&lt;command&gt;
	&lt;umbracoAlias&gt;mceYoutube&lt;/umbracoAlias&gt;
	&lt;icon&gt;../umbraco_client/tinymce/plugins/youtube/images/youtube.gif&lt;/icon&gt;
	&lt;tinyMceCommand value=&quot;&quot; userInterface=&quot;true&quot; frontendCommand=&quot;youtube&quot;&gt;youtube&lt;/tinyMceCommand&gt;
&lt;priority&gt;75&lt;/priority&gt;
&lt;/command&gt;</pre>
<p>Then after the last <code>&#60;plugin /&#62;</code> entry, add&#8230;</p>
<pre class="brush: xml;">
&lt;plugin loadOnFrontend=&quot;false&quot;&gt;youtube&lt;/plugin&gt;</pre>
</li>
<li>Once the XML config entries are in place, you will need to restart the  Umbraco application &#8211; the quickest way of doing this is by modifying your <code>Web.config</code>, (literally open it, add a space, remove it, hit save).</li>
<li>The YouTube button is now available in Umbraco. <strong>However, it&#8217;s not quite ready yet, there is still one more step!</strong></li>
<li>In your Umbraco back-end, go to the &#8220;Developer&#8221; section, expand the &#8220;DataTypes&#8221; folder and then select &#8220;Richtext editor&#8221;. In the &#8220;Buttons&#8221; section you should see a YouTube icon. Check the box next to the icon, and you&#8217;re done! If you don&#8217;t see the YouTube icon, then check that the did the config steps above, and/or check that the read permissions are set correctly on your <code>/umbraco_client/</code> folder, (re-apply them if needs be).</li>
</ol>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Umbraco Basics: Templates]]></title>
<link>http://blogbustingbeats.wordpress.com/2009/07/10/umbraco-basics-templates/</link>
<pubDate>Fri, 10 Jul 2009 11:03:52 +0000</pubDate>
<dc:creator>blogbustingbeats</dc:creator>
<guid>http://blogbustingbeats.wordpress.com/2009/07/10/umbraco-basics-templates/</guid>
<description><![CDATA[Right, so this is simple &#8211; thou perhaps not as simple in version 4 as in version 3. Main probl]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Right, so this is simple &#8211; thou perhaps not as simple in version 4 as in version 3. Main problem is simply just that the main vidoe tutorial on this only covers v3 &#8211; where we are dealing with raw HTML templates, whereas v4 now by default comes with support for .NET MasterPages switched on.</p>
<p>So where as the tutorial tells you that Umbraco templates are completely empty and that you can (must) start from scratch &#8211; the new v4 in stead comes with something like the below for default:</p>
<pre style="font:normal normal normal 12px/18px Consolas, Monaco, 'Courier New', Courier, monospace;">&#60;%@ Master Language="C#" MasterPageFile="~/umbraco/masterpages/default.master" AutoEventWireup="true" %&#62;

&#60;asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server"&#62;

&#60;/asp:Content&#62;</pre>
<p>So, I thought, well great that makes sense, and proceeded to try and nest another MasterPage below this. Full and nice support for this, but I kept getting this error message:</p>
<pre style="font:normal normal normal 12px/18px Consolas, Monaco, 'Courier New', Courier, monospace;">Cannot find ContentPlaceHolder 'masterContentPlaceHolder' in the master page '/masterpages/Master.master'</pre>
<p>So what the heck? Well, of course what I realised (fairly quicly, kinda :0) is that of course these MasterPages are placed inside the Umbraco page engine &#8211; which no doubt uses it&#8217;s own master page &#8211; so you have to realise that you are already in a MasterPage inheritance chain when you define your first base MasterPage.<br />
And what does that mean for us? Well it means that everything has to be wrapped in a Content tag &#8211; even from the very first start &#8211; to illustrate let me show you my new Base Master and a Home Page template that is nested in this:</p>
<pre style="font:normal normal normal 12px/18px Consolas, Monaco, 'Courier New', Courier, monospace;">&#60;%@ Master Language="C#" MasterPageFile="/umbraco/masterpages/default.master" AutoEventWireup="true" %&#62;

&#60;asp:Content  id="MasterContentPlaceHolder" ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server"&#62;

&#60;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&#62;

&#60;html&#62;

&#60;head&#62;&#60;/head&#62;

&#60;body&#62;

&#60;asp:ContentPlaceHolder Id="masterContentPlaceHolder" runat="server"&#62;&#60;/asp:ContentPlaceHolder&#62;

&#60;/body&#62;

&#60;/html&#62;

&#60;/asp:content&#62;
</pre>
<p><span style="font-family:Georgia;line-height:19px;white-space:normal;font-size:13px;">So note that the above is already nested into the Umbraco engine &#8211; hence the need for a &#60;asp:content tag at the base level before you can add any HTML.<br />
And so nested within the above I have my child template for the home page:</span></p>
<pre style="font:normal normal normal 12px/18px Consolas, Monaco, 'Courier New', Courier, monospace;">&#60;%@ Master Language="C#" MasterPageFile="/masterpages/Master.master" AutoEventWireup="true" %&#62;

&#60;asp:Content ContentPlaceHolderId="masterContentPlaceHolder" runat="server"&#62;

Home page Template Rules!

&#60;/asp:Content&#62;</pre>
<p>Hope that makes some sense.</p>
<p></span></span><br />
<span style="font-family:Georgia;font-size:small;"><span style="line-height:19px;white-space:normal;"><br />
</span></span></p>
<p><span style="font-family:Georgia;line-height:19px;white-space:normal;font-size:13px;">Some other useful and worthwhile features include the ability to insert data from your document types and generic Umbraco fields as well. Us the top buttons to do this.<br />
We will return to this in more detail later.</span></pre>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Umbraco Basics: Document Types (Tabs, Properties, Structure and Data Types)]]></title>
<link>http://blogbustingbeats.wordpress.com/2009/07/09/umbraco-basics-document-types-tabs-properties-structure-and-data-types/</link>
<pubDate>Thu, 09 Jul 2009 22:24:49 +0000</pubDate>
<dc:creator>blogbustingbeats</dc:creator>
<guid>http://blogbustingbeats.wordpress.com/2009/07/09/umbraco-basics-document-types-tabs-properties-structure-and-data-types/</guid>
<description><![CDATA[Right &#8211; so we&#8217;re playing with Umbraco, and watching some facinating videos online, and w]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Right &#8211; so we&#8217;re playing with Umbraco, and watching some facinating videos online, and we thought we&#8217;d share our pain with you here and tell you something about Document Types (don&#8217;t get me wrong, as CMS&#8217;s go Umbraco is pretty sweet).</p>
<p>So what are document types? Well together with Templates they form the core building blocks of Umbraco (Templates are covered later) &#8211; and whereas Templates defines the look and feel of a page, then the Document Type defines the data available to the page. Really you can think of it as a database table that you define for a certain type of pages.<br />
The data you define is what users can edit when working with pages of that type through the CMS. So think of them as blueprints or specifications for pages &#8211; defining the data that the Editor users will be asked for when creating new pages of that type.<br />
Some examples of document types could be &#8220;HomePage&#8221;, &#8220;StandardContentPage&#8221; or  &#8221;ArticlePage&#8221;,  &#8221;you name it&#8221; &#8211; I think is the general idea.</p>
<p>So, how is this done?<br />
Well, it&#8217;s done through <span style="text-decoration:underline;"><strong>Generic </strong></span><span style="text-decoration:underline;"><strong>Properties</strong></span> which each have a data type. Properties are in turn grouped into Tabs which provide a logical grouping for properties in the edit interface.<br />
Note that Properties all come with a set of meta data which really constitute the information you would normally glean from looking at a data table definition. This meta data includes Name, Alias (unique to the tab), Type (the data type) and of course the Tab which the property belongs to (required).</p>
<p>So, <span style="text-decoration:underline;"><strong>Tabs</strong></span> we have already touched on. Each document type can have one or more of these &#8211; effectively grouping the properties. Often you will find that these will correspond to the functional areas on your page layout (so for example MainContent, LatestNews, FooterInfo &#8211; etc).</p>
<p>Next we have <strong><span style="text-decoration:underline;">Structure</span></strong> information. This defines the hierachy of the Document Types (that again constitute the building blocks of your site). Here you can define which Document Types can be nested below others &#8211; this is termed &#8220;Allowed child nodetypes&#8221;.</p>
<p>And finally &#8211; thou first in the Document Type editor interface, we have the <strong><span style="text-decoration:underline;">Info meta data</span></strong>.<br />
This is just plain old descriptive information for your Document Type, like it&#8217;s name, icon, description &#8211; and the allowed Templates. Again, we will cover Templates in a tick &#8211; but for now just realise that Document Types are data definitions, this data can of course be showed in more than one way &#8211; and for this reason it is also possible to specify one or more &#8220;Allowed Templates&#8221; &#8211; i.e. one or more ways that the data (document type) can be displayed on the frontend.</p>
<p>One final aspect to touch on is the <strong><span style="text-decoration:underline;">Data Types</span></strong> of the Generic Properties. There are a long list of built in datatypes like number, textstring, Rich Text etc. Most of which funnily enough are listed not by type, but by the control type they are represented by in the editor interface (so we have for example a Rich Text Editor data type).<br />
Interestingly (and no doubt important) you can create your own custom data type by choosing a name and a base type (from Date, integer, Ntext and NVarchar). So, just to clarify &#8211; what this does is it allows you to present the editor with a control that allows them to select from a specific data type you defined.</p>
<p>No doubt we will have more fun with Data Types later on. For now, let&#8217;s move onto Templates</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Robots.txt for use with Umbraco]]></title>
<link>http://blog.leekelleher.com/2009/07/07/robots-txt-for-use-with-umbraco/</link>
<pubDate>Tue, 07 Jul 2009 16:10:30 +0000</pubDate>
<dc:creator>Lee Kelleher</dc:creator>
<guid>http://blog.leekelleher.com/2009/07/07/robots-txt-for-use-with-umbraco/</guid>
<description><![CDATA[I originally posted this over at the Our Umbraco community wiki. [Robots.txt for use with Umbraco] I]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><em>I originally posted this over at the Our Umbraco community wiki. [<a href="http://our.umbraco.org/wiki/reference/umbraco-best-practices/robotstxt-for-use-with-umbraco">Robots.txt for use with Umbraco</a>] I am only posting it on my blog as a cross-reference. The Our Umbraco wiki version will evolve with the community&#8217;s experience and knowledge.</em></p>
<p>The Robots Exclusion Protocol has been around for many years, yet there are a lot of web-developers who are unaware of the reasons for having a robots.txt file in the root of their websites.</p>
<p>There have been many rumours around whether the bigger search engine crwalers (i.e. Googlebot) consider your website amateurish if you didn&#8217;t have a robots.txt &#8211; and if handled badly, could lead to your site being invisible on SERPs.</p>
<p>If you are happy for a crawler to crawl/index all of your website&#8217;s content, then you can use the following:</p>
<pre class="brush: bash;">User-agent: *
Disallow:</pre>
<p>However, when using Umbraco to power my websites, it is preferable to define which folders are accessible by the crawler. Personally, I would not like to see the contents of my <code>/umbraco/</code> folder to be returned in Google&#8217;s SERPs.</p>
<p>Here is an example of the robots.txt that I have used on several Umbraco-powered websites.</p>
<pre class="brush: bash;"># robots.txt for Umbraco
User-agent: *
Disallow: /aspnet_client/
Disallow: /bin/
Disallow: /config/
Disallow: /css/
Disallow: /data/
Disallow: /scripts/
Disallow: /umbraco/
Disallow: /umbraco_client/
Disallow: /usercontrols/
Disallow: /xslt/</pre>
<p>From my perspective, there is no reason for a search engine crawler to be crawling/indexing files from any of the above folders &#8211; you may have a different perspective, to which you can amend your robots.txt accordingly.</p>
<p>For more information about the robots.txt standard, please refer to the official website: <a href="http://www.robotstxt.org/robotstxt.html">http://www.robotstxt.org/robotstxt.html</a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Source Code Released for User Control File Tree Umbraco Package]]></title>
<link>http://blog.leekelleher.com/2009/06/29/source-code-released-for-user-control-file-tree-umbraco-package/</link>
<pubDate>Mon, 29 Jun 2009 22:55:28 +0000</pubDate>
<dc:creator>Lee Kelleher</dc:creator>
<guid>http://blog.leekelleher.com/2009/06/29/source-code-released-for-user-control-file-tree-umbraco-package/</guid>
<description><![CDATA[A few months ago I released the User Control File Tree package for Umbraco, this allowed developers ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>A few months ago I released <a href="http://blog.leekelleher.com/2009/04/14/umbraco-package-ascx-usercontrol-file-editor-tree/">the User Control File Tree package for Umbraco</a>, this allowed developers to edit the front-end code/mark-up in their ASCX user-controls from the Umbraco back-end, (remotely), rather than editing them directly on the server via a text-editor.</p>
<p>Today I have <a href="http://umbracoext.codeplex.com/SourceControl/changeset/view/35032">released the source-code</a> on the <a href="http://umbracoext.codeplex.com/">Umbraco Extensions project</a> (on CodePlex) and created <a href="http://our.umbraco.org/projects/user-control-file-tree">a project page</a> on the new <a href="http://our.umbraco.org/">Our Umbraco community</a> website.</p>
<p>If you have any comments, feedback or suggestions &#8211; please feel free to get in touch with me via the Our Umbraco forums.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Codegarden 09]]></title>
<link>http://ismailmayat.wordpress.com/2009/06/11/codegarden-09/</link>
<pubDate>Thu, 11 Jun 2009 15:50:29 +0000</pubDate>
<dc:creator>ismailmayat</dc:creator>
<guid>http://ismailmayat.wordpress.com/2009/06/11/codegarden-09/</guid>
<description><![CDATA[It&#8217;s almost that time of year, Codegarden 09. I for one can&#8217;t wait. Looking forward to l]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>It&#8217;s almost that time of year, <a href="http://codegarden09.com" target="_blank">Codegarden 09</a>. I for one can&#8217;t wait. Looking forward to learning loads and meeting a great bunch of talented people.  I am flying out Sunday 21st June should be in Copenhagen around 3pm. Staying at <a href="http://www.avenuehotel.dk/index.php?id=1" target="_blank">Avenue hotel</a> so if anyone else is there or staying close by and wants to hook up drop me a comment.  Going to take my running stuff so if someone is really brave and feels like going for a run your more than welcome to join me.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[We're on the road to becoming Umbraco certified]]></title>
<link>http://cogblog.co.uk/2009/06/08/umbraco-certified/</link>
<pubDate>Mon, 08 Jun 2009 17:02:49 +0000</pubDate>
<dc:creator>trssaunders</dc:creator>
<guid>http://cogblog.co.uk/2009/06/08/umbraco-certified/</guid>
<description><![CDATA[Tim Saunders our development director flew over to Copenhagen last week and took one of Umbraco]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Tim Saunders our development director flew over to Copenhagen last week and took one of Umbraco&#8217;s fantastic and rigorous training courses.</p>
<p>After a couple of intense days with Umbraco&#8217;s founder Niels Hartvig, Tim emerged battered but unbowed with his Level 2 Umbraco professional certification proudly clutched in his hand.</p>
<p>What does this mean?</p>
<p>Well it&#8217;s the first step for us in our aim to become an Umbraco certified solutions provider. However it also means that we are well placed to perform complex integrations using the Umbraco platform.</p>
<p>We think Umbraco is a fantastic platform with a great future and we&#8217;re gald to be able to show our expertise in it on paper. Most of all though it means we can contribute even more to the thriving open source community which surrounds Umbraco.</p>
<p>Keep your eyes peeled for code snippets, tips, tricks and all sorts of Umbraco goodies over the coming weeks and months as we aim to make the <a href="http://www.thecogworks.co.uk">Cogworks</a> one of the top Umbraco solution providers in the UK.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Google Analytics for Umbraco - First Beta]]></title>
<link>http://blog.sitereactor.dk/2009/06/05/google-analytics-for-umbraco-first-beta/</link>
<pubDate>Fri, 05 Jun 2009 13:34:07 +0000</pubDate>
<dc:creator>Morten Christensen</dc:creator>
<guid>http://blog.sitereactor.dk/2009/06/05/google-analytics-for-umbraco-first-beta/</guid>
<description><![CDATA[I&#8217;m happy to announce the first beta release of my Google Analytics plugin/section for Umbraco]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>I&#8217;m happy to announce the first beta release of my Google Analytics plugin/section for Umbraco.<br />
The development took a bit longer then first anticipated, but I think it turned out really well. There are still a few bugs, so I don&#8217;t recommend that you install it in a customer solution just yet. This first release <span style="text-decoration:underline;">is</span> a beta release, so first off you should just try it out and please feel free to report any bugs you might find.<br />
When I have had a chance to clean up the source code, and documenting it I will release the code as open source.</p>
<p>Currently known bugs are:<br />
When submitting a new date range the first click on the button doesn&#8217;t raise the click event of the button, so you have to make your selection again and click the button to refresh the view with your new date range (default date range si one month).<br />
I&#8217;m currently using Googles Chart API to display the charts, so the amount of data that can be displayed is limited.</p>
<p>At the bottom of this post you will find a link to download the files necessary to install the google analytics plugin. This is not a &#8220;normal&#8221; umbraco package that you can install from within the client, so need to unpack the files within the root directory of you umbraco installation.<br />
These files are included in the package:<br />
web.config<br />
umbracoAppInserts.sql<br />
umbracoAppTreeUpdate.sql (only needed if you have downloaded the package before &#8211; contains sql fix).<br />
bin\Google.GData.Analytics.dll<br />
bin\Google.GData.Client.dll<br />
bin\Sitereactor.GoogleAnalytics.dll<br />
config\Analytics\Analytics.config<br />
config\Analytics\AnalyticsChartProperties.config<br />
umbraco\config\lang\*.xml<br />
umbraco\statistics\StatContent.aspx</p>
<p>So, there are a couple of things that you have to be aware of when installing/unpacking these files.<br />
First off, the web.config file is just a standard umbraco web.config so be sure not to overwrite you own. This file is simply included to shown you how and where to configure the google analytics account that you want displayed within Umbraco.<br />
Under &#60;appSettings&#62; you have to add the following to your web.config file:<br />
&#60;add key=&#8221;GoogleAnalytics.Email&#8221; value=&#8221;email@gmail.com&#8221;/&#62;<br />
&#60;add key=&#8221;GoogleAnalytics.Passwd&#8221; value=&#8221;password&#8221;/&#62;<br />
&#60;add key=&#8221;GoogleAnalytics.ProfileId&#8221; value=&#8221;ga:profileid&#8221;/&#62;</p>
<p>These three entries are your Google Analytics credentials. If you are unsure of what your profileid number is, then login to analytics, click on the account you want shown within umbraco, click view report and the id value of the querystring is your profileid <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The umbracoAppInserts.sql file is a sql script that creates three entries in your umbraco database, which will make the Statistics section appear within umbraco. Before you run this script, open it up and replace [umbracodatabasename] with [your db name].</p>
<p>Finally, in &#8220;umbraco\config\lang\&#8221; I have included the newest language files (from the 4.0.2.1 release) as all of these files include a translation for &#8220;Statistics&#8221; (the name of the section). You only need to extract these to your umbraco\config\lang directory if the section name looks like this: [stats]</p>
<p>I have included the latest release build of the Google Analytics .NET API, which is needed to get access to and retrieve data from the service.</p>
<p>The Sitereactor.GoogleAnalytics assembly contains all my wonderfull code <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  -&#62; Connecting to and retrieving analytics data feeds, manipulating the data and forming URLs for retrieving Google Charts (check out the API <a title="Google Chart API" href="http://code.google.com/intl/da/apis/chart/" target="_blank">here</a>). If you have a suggestion for another Chart implementation then googles, please let me know (should be open source).<br />
All of this code will become open source very soon.</p>
<p>StatContent.aspx handles the analytics views within umbraco.</p>
<p>Analytics.config and AnalyticsChartProperties.config are used to configure the five views within the statistics section (Dashboard, Visitors, Traffic Sources, Content and Goals). These views are exactly what you find on the Google Analytics site with the only difference that it is currently not possible to click the statistics and get a detailed view (this will be included in a future release).<br />
The usage of &#60;section name=&#8221;Dashboard&#8221;&#62; and &#60;report name=&#8221;Pageviews&#8221; chartType=&#8221;" chartData=&#8221;" aggregateType=&#8221;"&#62; within the Analytics.config-file is currently strongly typed, so you shouldn&#8217;t mess to much with this file &#8211; if you change the name attribute something will break or not shown up <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
The AnalyticsChartProperties.config-file you can go crazy with <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Values/InnerText only, though. Here, the size and color of small and large charts are specified. For example, a large SingleLineChart has a width of 500px and height of 125px, so if you want to increase that or maybe just change the color of the line, be my guest.</p>
<p>I think that was pretty much it. Let me know if you have any problems installing the section or experience bugs or differences in the datasets, please let me know (after you have double checked <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  ). All feedback is appriciated.</p>
<p>Here are some screens of what to expect &#8211; file at the bottom.</p>

<p><strong><a title="Google Analytics for Umbraco - First Beta" href="http://our.umbraco.org/projects/google-analytics-for-umbraco" target="_blank">Download the package from our.umbraco.org</a>.</strong></p>
<p><strong>UPDATE: Package updated with sql insert and update script.<br />
</strong>Previous package had a typo in the umbracoAppInserts.sql script (the column &#8220;treeHandlerType&#8221; in the &#8220;umbracoAppTree&#8221; table had &#8220;loadStatTree&#8221; &#8211; should be &#8220;LoadStatTree&#8221;). Caused the five nodes not loading.</p>
<p>PS: This release was only been tested with umbraco v4.0.1. If you have trouble installing it with v3, please let me know and I&#8217;ll look into it.</p>
<p><strong>UPDATE (07/07-09):</strong> This blog post is a bit our of date with regards to the installation of the add-in for umbraco. Please look to the project page on our.umbraco.org for the latest package.<br />
Current package is GoogleAnalytics_1.0.2-fixed.zip.<br />
<strong><a href="http://our.umbraco.org/projects/google-analytics-for-umbraco">Google Analytics for Umbraco Project page</a></strong></p>
</div>]]></content:encoded>
</item>

</channel>
</rss>
