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

<channel>
	<title>kipusoep's tech blog &#187; Umbraco</title>
	<atom:link href="http://tech.kipusoep.nl/category/umbraco/feed/" rel="self" type="application/rss+xml" />
	<link>http://tech.kipusoep.nl</link>
	<description>Tech blog by kipusoep</description>
	<lastBuildDate>Fri, 06 Jan 2012 10:08:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
		<item>
		<title>Umbraco, ELMAH (with SQL CE 4.0) and authentication</title>
		<link>http://tech.kipusoep.nl/2012/01/03/umbraco-elmah-with-sql-ce-4-0-and-authentication/</link>
		<comments>http://tech.kipusoep.nl/2012/01/03/umbraco-elmah-with-sql-ce-4-0-and-authentication/#comments</comments>
		<pubDate>Tue, 03 Jan 2012 09:03:36 +0000</pubDate>
		<dc:creator>kipusoep</dc:creator>
				<category><![CDATA[Asp.NET]]></category>
		<category><![CDATA[C#.NET]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[MS SQL]]></category>
		<category><![CDATA[Umbraco]]></category>

		<guid isPermaLink="false">http://tech.kipusoep.nl/?p=94</guid>
		<description><![CDATA[So this is the second blogpost I&#8217;m writing about Umbraco, ELMAH and authentication. My previous blogpost wasn&#8217;t really good, because with forms-authentication authenticated members could also access elmah, which is not the way to go. So I&#8217;ve dropped MADAM. This time I&#8217;ve managed to get both forms-authentication for umbraco and basic/windows-authentication for ELMAH. The trick [...]]]></description>
			<content:encoded><![CDATA[<p>So this is the second blogpost I&#8217;m writing about Umbraco, ELMAH and authentication.<br />
My <a href="http://tech.kipusoep.nl/2011/11/29/umbraco-elmah-madam-and-authentication/">previous blogpost</a> wasn&#8217;t really good, because with forms-authentication authenticated members could also access elmah, which is not the way to go. So I&#8217;ve dropped MADAM.</p>
<p>This time I&#8217;ve managed to get both forms-authentication for umbraco and basic/windows-authentication for ELMAH. The trick is to create a subfolder called &#8216;elmah&#8217;, which we&#8217;ll convert to an application and enable basic/windows-authenticatioin for this app.<br />
This is kind of tricky, because all web.config configurations will be inherited by the web.config for any sub-application. Also ELMAH filters the errors in the database based on the current Application string property, for example &#8220;/LM/W3SVC/24/ROOT&#8221;, but if you configure the elmah.axd handler in a sub-application, the application for the handler will be &#8220;/LM/W3SVC/24/ROOT/elmah&#8221; and you won&#8217;t see any logged errors of the main application.</p>
<p>To overcome this I had to make changes to ELMAH&#8217;s source code. I&#8217;ve cloned the Mercurial repo and changed some files. This way it&#8217;ll be easy to keep it up-to-date without losing my changes. There&#8217;s one extra thing I&#8217;ve changed; I&#8217;ve disabled logging the current user&#8217;s password, because of privacy reasons.</p>
<p>A step-by-step guide to get ELMAH and umbraco to play nicely side-by-side:</p>
<ol>
<li><a href="http://tech.kipusoep.nl/wp-content/uploads/2012/01/ELMAH-fix.zip">Download this zipfile</a> (which contains 3 other zip files)</li>
<li>Unzip the file &#8216;<strong>1. elmah.zip</strong>&#8216; in the root of your project and include the whole folder in Visual Studio (so it&#8217;ll get deployed with WebDeploy)</li>
<li>Unzip the file &#8216;<strong>2. elmah assemblies.zip</strong>&#8216; somewhere in your project, where all third party assemblies reside and optionally add a reference in Visual Studio (if you&#8217;d like to use <a href="http://code.google.com/p/elmah/wiki/DotNetSlackersArticle#Signaling_errors" target="_blank">Error Signalling</a> and if you&#8217;re using something like WebDeploy)</li>
<li>Unzip the file &#8216;<strong>3. sqlce assemblies.zip</strong>&#8216; in the root of your project and include both folders in Visual Studio. Inside VS select all files underneath the AMD64 and X86 folders and go to their properties. Set &#8216;Build action&#8217; to &#8216;None&#8217; and &#8216;Copy to Output Directory&#8217; to &#8216;Copy if newer&#8217; (screenshot below)<br />
<a href="http://tech.kipusoep.nl/wp-content/uploads/2012/01/assembly-properties.png"><img class="alignnone size-thumbnail wp-image-98" title="assembly properties" src="http://tech.kipusoep.nl/wp-content/uploads/2012/01/assembly-properties-150x150.png" alt="" width="150" height="150" /></a></li>
<li>Add the following to your web.config:<br />
&lt;system.data&gt;<br />
&lt;DbProviderFactories&gt;<br />
&lt;remove invariant=&#8221;System.Data.SqlServerCe.4.0&#8243; /&gt;<br />
&lt;add name=&#8221;Microsoft SQL Server Compact Data Provider 4.0&#8243; invariant=&#8221;System.Data.SqlServerCe.4.0&#8243; description=&#8221;.NET Framework Data Provider for Microsoft SQL Server Compact&#8221; type=&#8221;System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91&#8243; /&gt;<br />
&lt;/DbProviderFactories&gt;<br />
&lt;/system.data&gt;</li>
<li>Add the following to your web.config (inside the runtime\assemblyBinding element):<br />
&lt;dependentAssembly&gt;<br />
&lt;assemblyIdentity name=&#8221;System.Data.SqlServerCe&#8221; publicKeyToken=&#8221;89845dcd8080cc91&#8243; culture=&#8221;neutral&#8221; /&gt;<br />
&lt;bindingRedirect oldVersion=&#8221;0.0.0.0-4.0.0.0&#8243; newVersion=&#8221;4.0.0.0&#8243; /&gt;<br />
&lt;/dependentAssembly&gt;</li>
<li>If you were using ELMAH already in your project, remove any elmah.axd handlers in your web.config</li>
<li>If you&#8217;ve registered none-umbraco httpModules, please add them to the removal list in ~\elmah\web.config so they won&#8217;t be loaded for the ELMAH sub-application</li>
<li>Open IIS Manager and navigate to your website underneath &#8216;Sites&#8217;. Expand you site so you&#8217;ll see the directories underneath it and right-click the &#8216;elmah&#8217; folders and select &#8216;Convert to Application&#8217; and select the AppPool your site is running in</li>
<li>Next make sure this newly created sub-application is selected in the tree and open up &#8216;Authentication&#8217;. Enable &#8216;Basic Authentication&#8217; and you&#8217;re ready to start logging and reading errors!</li>
</ol>
<p>The ELMAH page can be accessed by navigating to &#8216;/elmah/&#8217; or just &#8216;/elmah/elmah.axd&#8217;.<br />
The SQL CE error log database will be stored in &#8216;~/App_Data/&#8217;. You could monitor the size of this file as it will grow to max 1024MB.</p>
]]></content:encoded>
			<wfw:commentRss>http://tech.kipusoep.nl/2012/01/03/umbraco-elmah-with-sql-ce-4-0-and-authentication/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Umbraco, ELMAH, MADAM and authentication</title>
		<link>http://tech.kipusoep.nl/2011/11/29/umbraco-elmah-madam-and-authentication/</link>
		<comments>http://tech.kipusoep.nl/2011/11/29/umbraco-elmah-madam-and-authentication/#comments</comments>
		<pubDate>Tue, 29 Nov 2011 15:57:25 +0000</pubDate>
		<dc:creator>kipusoep</dc:creator>
				<category><![CDATA[Asp.NET]]></category>
		<category><![CDATA[C#.NET]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[Umbraco]]></category>

		<guid isPermaLink="false">http://tech.kipusoep.nl/?p=75</guid>
		<description><![CDATA[Please refer to this blogpost Warning &#8211; read first: There is an issue with this approach; when you&#8217;re authenticated via Forms Authentication (like being logged in on the website), you&#8217;re ALSO allowed to access elmah.axd. I have looked for a solution, but I haven&#8217;t figured one yet. Do you have the solution? Please reply on [...]]]></description>
			<content:encoded><![CDATA[<h2><strong><span style="text-decoration: underline;"><a href="http://tech.kipusoep.nl/2012/01/03/umbraco-elmah-with-sql-ce-4-0-and-authentication/">Please refer to this blogpost</a></span></strong></h2>
<p><span style="text-decoration: underline;"><strong>Warning &#8211; read first:</strong></span><strong> </strong>There is an issue with this approach; when you&#8217;re authenticated via Forms Authentication (like being logged in on the website), you&#8217;re ALSO allowed to access elmah.axd.<br />
I have looked for a solution, but I haven&#8217;t figured one yet. Do you have the solution? Please reply on this blog and I&#8217;ll include your information.</p>
<hr />
We&#8217;re using <a href="http://code.google.com/p/elmah/" target="_blank">ELMAH </a>in every single umbraco project we built, it&#8217;s an awesome error logging module for .NET.</p>
<p>To protect ELMAH, we were using Basic Authentication, which is built-in in .NET and IIS.<br />
But since umbraco v4.7.1, umbraco relies on Forms Authentication for the Members. As you might know, it&#8217;s impossible to have Basic AND Forms Authentication enabled at the same time, so the quick conclusion was to go with Forms Authentication, else umbraco&#8217;s membership provider wouldn&#8217;t work anymore.</p>
<p>So now we have a problem: whenever someone&#8217;s logged in as a member, he/she can access elmah.axd (assuming that you&#8217;ve got elmah.axd protected as <a href="http://haacked.com/archive/2007/07/24/securely-implement-elmah-for-plug-and-play-error-logging.aspx" target="_blank">described here</a>).<br />
Wouldn&#8217;t it be awesome  if we could still use some sort of Basic Authentication AND Forms Authentication? Ofcourse! That&#8217;s where <a href="http://www.raboof.com/projects/madam/" target="_blank">MADAM </a>steps in (from the creator of ELMAH, isn&#8217;t that coincidental?).</p>
<p>So here&#8217;s a guide how to set-up your project (which I assume already has ELMAH running and configured, <a href="http://blog.leekelleher.com/2009/04/23/integrating-elmah-with-umbraco/" target="_blank">as described here for example</a>):<br />
<strong>Add the MADAM assembly to the bin folder (+ reference if you use VS)<br />
</strong><strong>Some stuff in the web.config:</strong></p>
<ul>
<li style="font-weight: bold;"><strong>Add sectionGroup for madam:</strong></li>
</ul>
<p><span style="font-weight: normal;"> </span></p>
<pre class="brush: xml; title: ; notranslate">
&lt;sectionGroup name=&quot;madam&quot;&gt;
&lt;section type=&quot;Madam.FormsAuthenticationDispositionSectionHandler, Madam&quot;/&gt;
&lt;section type=&quot;System.Configuration.SingleTagSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&quot;/&gt;
&lt;/sectionGroup&gt;
</pre>
<ul style="font-weight: normal;">
<li><strong>Add httpModules to system.web/httpModules and system.webServer/modules:</strong></li>
</ul>
<pre class="brush: xml; title: ; notranslate">
&lt;add name=&quot;FormsAuthenticationDisposition&quot; type=&quot;Madam.FormsAuthenticationDispositionModule, Madam&quot;/&gt;&lt;/pre&gt;
&lt;!-- IMPORTANT! The actual HTTP authentication module MUST appear  AFTER the FormsAuthenticationDisposition module. --&gt;
&lt;add name=&quot;BasicAuthentication&quot; type=&quot;Madam.BasicAuthenticationModule, Madam&quot;/&gt;
</pre>
<ul style="font-weight: normal;">
<li><strong>Extend the &lt;authentication mode=”Forms” /&gt; tag in &lt;system.web&gt;:</strong></li>
</ul>
<pre class="brush: xml; title: ; notranslate">
&lt;authentication mode=&quot;Forms&quot;&gt;
&lt;forms&gt;
&lt;credentials passwordFormat=&quot;SHA1&quot;&gt;
&lt;user name=&quot;elmah&quot; password=&quot;&lt;&lt;&lt;YOUR_SHA1_HASHED_PASSWORD&gt;&gt;&quot;/&gt;
&lt;/credentials&gt;
&lt;/forms&gt;
&lt;/authentication&gt;
</pre>
<ul style="font-weight: normal;">
<li><strong>Add a location element to protect elmah.axd:</strong></li>
</ul>
<pre class="brush: xml; title: ; notranslate">
&lt;location path=&quot;elmah.axd&quot;&gt;
&lt;system.web&gt;
&lt;authorization&gt;
&lt;deny users=&quot;?&quot;/&gt;
&lt;/authorization&gt;
&lt;/system.web&gt;
&lt;/location&gt;
</pre>
<ul style="font-weight: normal;">
<li><strong>Add a madam element, like after the elmah element:</strong></li>
</ul>
<pre class="brush: xml; title: ; notranslate">
&lt;madam&gt;
&lt;userSecurityAuthority realm=&quot;ELMAH&quot; provider=&quot;Madam.FormsUserSecurityAuthority&quot; exposeClearTextPassword=&quot;false &quot;/&gt;
&lt;formsAuthenticationDisposition&gt;
&lt;discriminators all=&quot;true&quot;&gt;
&lt;!-- This discriminator helps detect redirection to the Forms login page. --&gt;
&lt;discriminator inputExpression=&quot;Response.RedirectLocation&quot; pattern=&quot;login\.aspx\?returnurl\=&quot; type=&quot;Madam.RegexDiscriminator&quot;/&gt;
&lt;!-- These discriminators are based on the various locations  and requests for which Forms should be discriminated.  The conditions expressed by these discriminators  are OR'ed together in the absence of the all attribute. --&gt;
&lt;discriminator&gt;
&lt;discriminator inputExpression=&quot;Request.RawUrl&quot; pattern=&quot;^/elmah\.axd&quot;/&gt;
&lt;/discriminator&gt;
&lt;/discriminators&gt;
&lt;/formsAuthenticationDisposition&gt;
&lt;/madam&gt;
</pre>
<p>That’s “all” <img src='http://tech.kipusoep.nl/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  Good luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://tech.kipusoep.nl/2011/11/29/umbraco-elmah-madam-and-authentication/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Umbraco 4.7.1, TinyMCE and embedding Flash / objects</title>
		<link>http://tech.kipusoep.nl/2011/11/09/umbraco-4-7-1-tinymce-and-embedding-flash-objects/</link>
		<comments>http://tech.kipusoep.nl/2011/11/09/umbraco-4-7-1-tinymce-and-embedding-flash-objects/#comments</comments>
		<pubDate>Wed, 09 Nov 2011 19:47:58 +0000</pubDate>
		<dc:creator>kipusoep</dc:creator>
				<category><![CDATA[Asp.NET]]></category>
		<category><![CDATA[C#.NET]]></category>
		<category><![CDATA[Umbraco]]></category>

		<guid isPermaLink="false">http://tech.kipusoep.nl/?p=71</guid>
		<description><![CDATA[Lately I&#8217;ve been upgrading some websites built on umbraco 4.0.x. Most of these websites were using object tags in the TinyMCE editor to show rich content, like flash, but since we upgraded those websites to 4.7.1, the object tag wasn&#8217;t displayed anymore in the HTML of the TinyMCE editor. So when changing and publishing such [...]]]></description>
			<content:encoded><![CDATA[<p>Lately I&#8217;ve been upgrading some websites built on umbraco 4.0.x.<br />
Most of these websites were using object tags in the TinyMCE editor to show rich content, like flash, but since we upgraded those websites to 4.7.1, the object tag wasn&#8217;t displayed anymore in the HTML of the TinyMCE editor.<br />
So when changing and publishing such page, the object tags get removed from the front-end, because they were missing in TinyMCE itself.</p>
<p>This is really annoying ofcourse, because some pages couldn&#8217;t be edited anymore. I&#8217;ve looked around the net for solutions/other people experiencing the same problem.<br />
There are some <a href="http://umbraco.codeplex.com/workitem/30378" target="_blank">bug reports</a> on Codeplex, but these are other problems than I was facing.</p>
<p>So I just thought; let&#8217;s upgrade TinyMCE included in umbraco from version 3.4 to 3.4.7 and this fixed my problem.<br />
There are some <a href="http://umbraco.codeplex.com/workitem/30512" target="_blank">bug</a> <a href="http://umbraco.codeplex.com/workitem/30395" target="_blank">reports</a> on Codeplex to upgrade TinyMCE (and jQuery) to the latest version. Please vote for them!</p>
]]></content:encoded>
			<wfw:commentRss>http://tech.kipusoep.nl/2011/11/09/umbraco-4-7-1-tinymce-and-embedding-flash-objects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Umbraco 4.5 &amp; Visual Studio 2010 &amp; .Less &amp; jQuery vsdoc &amp; SquishIt &amp; masterpages</title>
		<link>http://tech.kipusoep.nl/2010/07/23/umbraco-45-visual-studio-2010-dotless-jquery-vsdoc-squishit-masterpages/</link>
		<comments>http://tech.kipusoep.nl/2010/07/23/umbraco-45-visual-studio-2010-dotless-jquery-vsdoc-squishit-masterpages/#comments</comments>
		<pubDate>Fri, 23 Jul 2010 15:06:04 +0000</pubDate>
		<dc:creator>kipusoep</dc:creator>
				<category><![CDATA[Asp.NET]]></category>
		<category><![CDATA[C#.NET]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Umbraco]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://tech.kipusoep.nl/?p=37</guid>
		<description><![CDATA[Using Umbraco with VS2010 … and masterpages, jQuery vsdoc, dotless, SquishIt Welcome all to this magnificent blogpost about using Umbraco 4.5 with Visual Studio 2010 and everything you’ll need to know about some other tools! First things first; we, at InfoCaster, use Visual Studio 2010 and .NET to develop our Umbraco web applications. We try [...]]]></description>
			<content:encoded><![CDATA[<h1>Using Umbraco with VS2010</h1>
<address><span style="color: #888888;">… and masterpages, jQuery vsdoc, dotless, SquishIt</span></address>
<p>Welcome all to this magnificent blogpost about using Umbraco 4.5 with Visual Studio 2010 and everything you’ll need to know about some other tools! <img src='http://tech.kipusoep.nl/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>First things first; we, at InfoCaster, use Visual Studio 2010 and .NET to develop our Umbraco web applications. We try <strong>not </strong>to use XSLT, just because .NET is much better <img src='http://tech.kipusoep.nl/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  and everyone at InfoCaster knows .NET, unlike XSLT. I always like to say that .NET with LINQ can do like everything, but XSLT can’t or does things inefficient. It’s not even possible to assign a value to a variable for a second time. How variable is that ‘variable’ then? But that’s another discussion!</p>
<p>So a few months ago I started developing our own ‘Umbraco Website Starter project’. It’s like a clean Umbraco installation wrapped in a Visual Studio solution, with some extra’s, like some handy extension methods, pre-installed packages and default properties for the homepage (title prefix/suffix, Google analytics code, meta data etc.).</p>
<p>Now I migrated it to Umbraco 4.5 and removed all packages and installed the necessary packages again. I’d like to tell you all what I did and how.</p>
<h2>Blueprint CSS</h2>
<p>We’re using Blueprint CSS from now on to have a good start on creating our templates and stylesheets, this is combined with SquishIt.</p>
<h2>.Less</h2>
<p>We’re using .Less for our custom stylesheet. You can read everything about how to set this up in VS(2010), so I’m not going to explain that: <a href="http://www.dotlesscss.com/">http://www.dotlesscss.com/</a></p>
<p>I&#8217;m using SquishIt to generate the CSS files out of the .css.less files. These .css.less files can be opened with VS2010 <strong>with</strong> css highlighting / autocompletion by using this plug-in: <a href="http://visualstudiogallery.msdn.microsoft.com/en-us/dd5635b0-3c70-484f-abcb-cbdcabaa9923">http://visualstudiogallery.msdn.microsoft.com/en-us/dd5635b0-3c70-484f-abcb-cbdcabaa9923</a></p>
<pre class="brush: csharp; title: ; notranslate">
&lt;%= Bundle.Css()
	.Add(&quot;~/css/blueprint/screen.css&quot;)
	.Add(&quot;~/css/style.css.less&quot;)
	.WithMedia(&quot;screen, projection&quot;)
	.Render(&quot;~/css/output/screen_#.css&quot;)
%&gt;
</pre>
<h2>SquishIt and jQuery vsdoc</h2>
<p>SquishIt download page: <a href="http://www.codethinked.com/post/2010/05/26/SquishIt-The-Friendly-ASPNET-JavaScript-and-CSS-Squisher.aspx">http://www.codethinked.com/post/2010/05/26/SquishIt-The-Friendly-ASPNET-JavaScript-and-CSS-Squisher.aspx</a></p>
<p>VS2010 has better intellisense features when it comes to JavaScript. So why not use jQuery with vsdoc and let SquishIt minimize and combine it for production environments?</p>
<p>Great idea! BUT this is how SquishIt requires it’s mark-up:</p>
<pre class="brush: csharp; title: ; notranslate">
&lt;%= Bundle.JavaScript()
    .Add(&quot;~/js/jquery-1.4.2.js&quot;)
    .Add(&quot;~/js/jquery-ui-1.8.1.js&quot;)
    .Render(&amp;quot;~/js/combined_#.js&quot;)
%&gt;
</pre>
<p>Hmm… That’s not going to work with intellisense/vsdoc, because Visual Studio looks for real &lt;script&gt; tags…</p>
<p>So what I did is this:</p>
<pre class="brush: csharp; title: ; notranslate">
&lt;asp:Literal runat=&quot;server&quot; ID=&quot;ltlScripts&quot;&gt;
    &lt;script type=&quot;text/javascript&quot; src=&quot;~/scripts/jquery-1.4.2.js&quot;&gt;&lt;/script&gt;
&lt;/asp:Literal&gt;
</pre>
<p>Then you can just add any JavaScript reference you’d like <img src='http://tech.kipusoep.nl/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  <strong>To enable vsdoc intellisense, you must also have the vsdoc file in the same folder as the realy jQuery file</strong></p>
<p>The literal is being parsed in code-behind by using regex and it gets rewritten:</p>
<pre class="brush: csharp; title: ; notranslate">
Regex scriptTagRegex = new Regex(@&quot;&lt;script(.*)type=&quot;&quot;text/javascript&quot;&quot;(.*)src=&quot;&quot;(.*)&quot;&quot;.*&gt;&lt;/script&gt;&quot;);
IJavaScriptBundle jsBundle = Bundle.JavaScript();
IJavaScriptBundleBuilder jsBundleBuilder = null;
foreach (Match match in scriptTagRegex.Matches(ltlScripts.Text))
{
    if (jsBundleBuilder == null)
        jsBundleBuilder = jsBundle.Add(match.Groups[3].Value);
    else
        jsBundleBuilder.Add(match.Groups[3].Value);
}
ltlScripts.Text = jsBundleBuilder.Render(&quot;~/scripts/output/js_#.js&quot;);
</pre>
<p>Simple as that <img src='http://tech.kipusoep.nl/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  (using SquishIt.Framework.JavaScript)</p>
<h2>Default meta properties</h2>
<p>(title prefix/suffix, meta tags, meta description, meta title, favicon, Google analytics)</p>
<p>This is the markup I have as &lt;head&gt;:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;head runat=&quot;server&quot;&gt;
    &lt;title&gt;Title will be filled from codebehind&lt;/title&gt;

    &lt;!-- meta data --&gt;
    &lt;meta name=&quot;author&quot; content=&quot;InfoCaster B.V.&quot; /&gt;
    &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
    &lt;meta name=&quot;keywords&quot; content=&quot;&lt;%= CurrentNode.GetPropertyValueRecursive(&quot;pageKeywords&quot;) %&gt;&quot; /&gt;
    &lt;meta name=&quot;description&quot; content=&quot;&lt;%= CurrentNode.GetPropertyValueRecursive(&quot;pageDescription&quot;) %&gt;&quot; /&gt;

    &lt;asp:Literal runat=&quot;server&quot; ID=&quot;ltlFavicon&quot;&gt;
    &lt;!-- favicon --&gt;
    &lt;link rel=&quot;shortcut icon&quot; href=&quot;#HandledInCodeBehind&quot; type=&quot;image/x-icon&quot; /&gt;
    &lt;/asp:Literal&gt;

    &lt;!-- css --&gt;
    &lt;%= Bundle.Css()
        .Add(&quot;~/css/blueprint/screen.css&quot;)
        .Add(&quot;~/css/style.css.less&quot;)
        .WithMedia(&quot;screen, projection&quot;)
        .Render(&quot;~/css/output/screen_#.css&quot;)
    %&gt;
    &lt;%= Bundle.Css()
        .Add(&quot;~/css/blueprint/print.css&quot;)
        .WithMedia(&quot;print&quot;)
        .Render(&quot;~/css/output/print_#.css&quot;)
    %&gt;
    &lt;!--[if lt IE 8]&gt;
    &lt;%= Bundle.Css()
        .Add(&quot;~/css/blueprint/ie.css&quot;)
        .WithMedia(&quot;screen, projection&quot;)
        .Render(&quot;~/css/output/ie_#.css&quot;)
    %&gt;
    &lt;![endif]--&gt;
    &lt;asp:ContentPlaceHolder runat=&quot;server&quot; ID=&quot;cphHead&quot; /&gt;

    &lt;!-- js @ bottom --&gt;

    &lt;asp:Literal runat=&quot;server&quot; ID=&quot;ltlGoogleAnalytics&quot;&gt;
    &lt;!-- Google Analytics --&gt;
    &lt;script type=&quot;text/javascript&quot;&gt;
        var _gaq = _gaq || [];
        _gaq.push(['_setAccount', '{0}']);
        _gaq.push(['_trackPageview']);

        (function () {{
            var ga = document.createElement('script');
            ga.type = 'text/javascript';
            ga.async = true;
            ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
            var s = document.getElementsByTagName('script')[0];
            s.parentNode.insertBefore(ga, s);
        }})();
    &lt;/script&gt;
    &lt;/asp:Literal&gt;
&lt;/head&gt;
</pre>
<p>The title, favicon and Google analytics gets set from code-behind.</p>
<p>The meta tags/description are filled by using a recursive extension method I wrote.</p>
<p>I also added a content placeholder in the head and also at the end of the XHTML document, right before the &lt;/body&gt;, so it’s possible to load custom CSS (head) and JS (bottom) per sub masterpage.</p>
<p>This is the code-behind which belongs to this mark-up:</p>
<pre class="brush: csharp; title: ; notranslate">
protected override void OnPreRender(EventArgs e)
{
    base.OnPreRender(e);

    #region Page stuff (google analytics, favicon, title)
    // Google analytics
    if (!string.IsNullOrEmpty(CurrentNode.GetPropertyValueRecursive(&quot;analyticsCode&quot;)))
        ltlGoogleAnalytics.Text = string.Format(
            ltlGoogleAnalytics.Text,
            CurrentNode.GetPropertyValueRecursive(&quot;analyticsCode&quot;)
        );
    else
        ltlGoogleAnalytics.Visible = false;

    // Favicon
    int faviconId;
    if (!string.IsNullOrEmpty(CurrentNode.GetPropertyValueRecursive(&quot;favicon&quot;)) &amp;&amp; int.TryParse(CurrentNode.GetPropertyValueRecursive(&quot;favicon&quot;), out faviconId))
        ltlFavicon.Text = string.Format(
            &quot;{0}{1}{2}&quot;,
            ltlFavicon.Text.Substring(0, ltlFavicon.Text.IndexOf(&quot;href=\&quot;&quot;) + (&quot;href=\&quot;&quot;).Length),
            new Media(faviconId).getProperty(&quot;umbracoFile&quot;).Value,
            ltlFavicon.Text.Substring(ltlFavicon.Text.IndexOf(&quot;href=\&quot;\&quot;&quot;) + (&quot;href=\&quot;&quot;).Length)
        );
    else
        ltlFavicon.Visible = false;

    // Title
    Page.Title = string.Format(
        &quot;{0}{1}{2}&quot;,
        CurrentNode.GetPropertyValueRecursive(&quot;titlePrefix&quot;),
        CurrentNode.GetPropertyValueOrDefault(&quot;pageTitle&quot;, CurrentNode.Name),
        CurrentNode.GetPropertyValueRecursive(&quot;titleSuffix&quot;)
    );
    #endregion
}
</pre>
<p>Easy right? <img src='http://tech.kipusoep.nl/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<h2>Extension methods</h2>
<p>I wrote some extension methods to ease some default tasks.</p>
<p>These extension methods are duplicated, for use in multilingual sites.</p>
<p>You can download the .cs file right here, it contains enough comments/documentation. Look at the end of this post <img src='http://tech.kipusoep.nl/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<h2>Masterpage intellisense VS2010 bug</h2>
<p>There is a bug in VS2010 when using Umbraco’s masterpage as root master (umbraco.presentation.masterpages._default). The intellisense doesn’t work anymore. I’ve created a bug report on Microsoft Connect about this: <a href="https://connect.microsoft.com/VisualStudio/feedback/details/567771/no-asp-tag-intellisense-in-some-cases-when-using-masterpages">https://connect.microsoft.com/VisualStudio/feedback/details/567771/no-asp-tag-intellisense-in-some-cases-when-using-masterpages</a></p>
<p>I’ve got a ‘dirty’ work-around. I don’t know if this work-around works with the ‘Canvas-editing’ feature in Umbraco (we and our customers don’t use it).</p>
<p>Just let every main masterpage (with &lt;html&gt; tags) inherit: umbraco.presentation.masterpages._default</p>
<h2>#Protip: Creating new templates</h2>
<p>When using Visual Studio, it’s nice to have code-behind files for your templates (at least, that’s how we do stuff). If you create a template in Umbraco, it creates a masterpage without code-behind…</p>
<p>Then you would have to add a code-behind manually, link it with the mark-up and create designer file. That sucks right?</p>
<p>Just do this:</p>
<ol>
<li>Create a nested masterpage in VS and use your ‘master’-masterpage as masterpage in the masterpages folder. Lol, there’s a lot of ‘masterpage’ in that sentence hehe.</li>
<li>VS creates a masterpage for you with code-behind, sweet!</li>
<li>VS opens the mark-up of this newly created masterpage, <strong>keep it opened</strong>!</li>
<li>Then go to your Umbraco back-end and create a template like you would normally do. Give it the same name as you defined in step 1.<br />
This should create an Umbraco template by using the already created masterpage as file.</li>
<li>Now return to Visual Studio. It should notify you that the file has changed and gives you the option to reload the file. Reload and then use CTRL+Z to undo the changes made by Umbraco (else the code-behind won’t be linked to the mark-up) and save it.</li>
<li>You’re done!</li>
</ol>
<h2>Downloads</h2>
<p>&#8216;Master&#8217;-Masterpage with code-behind: <a href="http://tech.kipusoep.nl/wp-content/uploads/2010/07/StefanKip.InfoCaster.Umbraco.masterpage.zip">StefanKip.InfoCaster.Umbraco.masterpage</a></p>
<p>Extension methods: <a href="http://tech.kipusoep.nl/wp-content/uploads/2010/07/UmbracoExtensions.cs_.txt">UmbracoExtensions.cs</a> (remove ending .txt)</p>
]]></content:encoded>
			<wfw:commentRss>http://tech.kipusoep.nl/2010/07/23/umbraco-45-visual-studio-2010-dotless-jquery-vsdoc-squishit-masterpages/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>301 URL Tracker v1.1 for Umbraco</title>
		<link>http://tech.kipusoep.nl/2010/05/12/301-url-tracker-v1-1-for-umbraco/</link>
		<comments>http://tech.kipusoep.nl/2010/05/12/301-url-tracker-v1-1-for-umbraco/#comments</comments>
		<pubDate>Wed, 12 May 2010 18:28:02 +0000</pubDate>
		<dc:creator>kipusoep</dc:creator>
				<category><![CDATA[Asp.NET]]></category>
		<category><![CDATA[C#.NET]]></category>
		<category><![CDATA[Umbraco]]></category>

		<guid isPermaLink="false">http://tech.kipusoep.nl/?p=29</guid>
		<description><![CDATA[I just released an update for the 301 URL Tracker for Umbraco: http://bit.ly/301URLTracker Changelist [Bug fix (critical)] The 404 Handler returned &#8217;301 URL Tracker&#8217; as HTTP Status instead of &#8217;301 Moved Permanently&#8217; [New feature] View/manage Url Mappings on the node itself with the new 301 URL Tracker Datatype (ofcourse you must add a property, with [...]]]></description>
			<content:encoded><![CDATA[<p>I just released an update for the 301 URL Tracker for Umbraco: <a href="http://bit.ly/301URLTracker" target="_blank">http://bit.ly/301URLTracker</a></p>
<h3>Changelist</h3>
<ul>
<li>[Bug fix (critical)] The 404 Handler returned &#8217;301 URL Tracker&#8217;  as HTTP Status instead of &#8217;301 Moved Permanently&#8217;</li>
<li>[New feature] View/manage Url Mappings on the node itself with  the new 301 URL Tracker Datatype (ofcourse you must add a property, with  the 301 URL Tracker Datatype, to a Document Type and <strong>!!!REMOVE  IT  WHEN YOU ARE GOING TO UN-INSTALL THE 301 URL TRACKER !!!</strong>)</li>
<li>[New feature] Create RegEx Url Mappings (url mappings will be  tried to match first, if no match found RegEx matching kicks in, ordered  by Insertion date ascending)</li>
<li>[New feature] Option to disable the 301 URL Tracker (add to  appSettings: &lt;add key=&#8221;infocasterDisable301URLTracker&#8221; value=&#8221;true&#8221;  /&gt;</li>
<li>[New feature] When clicking on the &#8217;301 URL Tracker&#8217; node in  the tree, there&#8217;s a button to view all not found requests</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://tech.kipusoep.nl/2010/05/12/301-url-tracker-v1-1-for-umbraco/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>301 URL Tracker for Umbraco</title>
		<link>http://tech.kipusoep.nl/2010/04/28/301-url-tracker-for-umbraco/</link>
		<comments>http://tech.kipusoep.nl/2010/04/28/301-url-tracker-for-umbraco/#comments</comments>
		<pubDate>Wed, 28 Apr 2010 21:52:57 +0000</pubDate>
		<dc:creator>kipusoep</dc:creator>
				<category><![CDATA[Asp.NET]]></category>
		<category><![CDATA[C#.NET]]></category>
		<category><![CDATA[Umbraco]]></category>

		<guid isPermaLink="false">http://tech.kipusoep.nl/?p=25</guid>
		<description><![CDATA[Just released my second package for Umbraco; the 301 URL Tracker. I could really use some feedback for my graduation report, so please leave some when you&#8217;ve given it a run! Release notes About the 301 URL Tracker package The 301 URL Tracker package is created by InfoCaster. The original idea comes from Soeteman Software. [...]]]></description>
			<content:encoded><![CDATA[<p>Just released my second package for Umbraco; the <a href="http://our.umbraco.org/projects/301-url-tracker">301 URL Tracker</a>.</p>
<p>I could really use some feedback for my graduation report, so please leave some when you&#8217;ve given it a run!</p>
<h2>Release notes</h2>
<div>
<h3>About the 301 URL Tracker package</h3>
<p>The 301 URL Tracker package is created by <a rel="nofollow" href="http://www.infocaster.net/">InfoCaster</a>. The  original idea comes from <a rel="nofollow" href="http://www.soetemansoftware.nl/">Soeteman Software</a>.</p>
<p>The purpose of the 301 URL Tracker package, is to create some SEO  friendlyness.<br />
Search engines crawl your website and store links to all pages  within your website.<br />
The 301 URL Tracker keeps track of all the url changes of these  pages:</p>
<ul>
<li>When a document is moved it gets a new url</li>
<li>When a document is renamed it gets a new url</li>
</ul>
<p>The old urls are stored and when someone requests one of these old  urls, they are automatically transfered to the correct new url, with a  301 HTTP response.<br />
Search engines recognize this HTTP response and replace the old  location with the new location.</p>
<p>All features of the 301 URL Tracker package:</p>
<ul>
<li>Keeps track of url changes and redirects requests from these  &#8216;old&#8217; urls to the new ones</li>
<li>Ability to create custom url mappings, e.g. when you get a new  website, the urls can be changed. This way you can map old urls to new  ones</li>
<li>Remove any url mapping; automatically tracked urls and custom  mapped urls</li>
</ul>
<h3>Some hints</h3>
<ul>
<li>When a document gets a new url, the old url is saved and the  document is automatically added to the 301 URL Tracker tree <strong>(including   all child documents)</strong></li>
<li>When one wants to create a custom url mapping, just right-click  on the 301 URL Tracker node and click &#8216;Create&#8217;. Select the document to  create the custom url mapping for</li>
<li>The reason for an automatic mapping is shows next to the mapping  url. When creating custom mappings, you can add your own note to the  mapping</li>
<li>To delete all url mappings for a document, just right-click on  the document in the 301 URL Tracker tree and press &#8216;Delete&#8217;. <strong>Important   note: the documents underneath the deleted one will NOT be removed,  although it looks like they are</strong></li>
<li>The url mappings are ordered by date descending. To view the  creation date of a mapping, hover with the mouse over the url of a  mapping entry</li>
<li>When a document with configured url mappings gets recycled, it  won&#8217;t show up in the 301 URL Tracker tree anymore (and the url mappings  won&#8217;t work)</li>
<li>When a document gets moved back from the recycle bin, it shows  up again in the 301 URL Tracker tree. When a document gets deleted for  real, the url mappings get deleted too</li>
</ul>
<h3>Graduation project</h3>
<p>This package is part of my graduation project. Yes, I&#8217;m trying to  graduate with Umbraco as graduation topic. So I would like to call in <strong>your  help</strong>!<br />
I really need feedback for my graduation report. So  please, if you have a spare moment, leave some feedback in the &#8216;Feedback  forum&#8217; below.<br />
Thank you all very much in advance!</p>
<h3>Requirements</h3>
<ul>
<li>.NET 3.5</li>
<li>SQL Server</li>
</ul>
<h3>Tested on</h3>
<ul>
<li>.NET 3.5</li>
<li>SQL Server 2008</li>
<li>Windows 7 Ultimate</li>
<li>IIS 7.5</li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://tech.kipusoep.nl/2010/04/28/301-url-tracker-for-umbraco/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>True Color Picker for Umbraco</title>
		<link>http://tech.kipusoep.nl/2009/11/13/true-color-picker-for-umbraco/</link>
		<comments>http://tech.kipusoep.nl/2009/11/13/true-color-picker-for-umbraco/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 23:13:43 +0000</pubDate>
		<dc:creator>kipusoep</dc:creator>
				<category><![CDATA[Umbraco]]></category>

		<guid isPermaLink="false">http://tech.kipusoep.nl/?p=22</guid>
		<description><![CDATA[This package will create a DataType called &#8220;True Color Picker&#8221;. You may be wondering, what&#8217;s &#8220;True&#8221; doing there? Well I was looking for a color picker without the need to provide pre-defined colors. I saw the built-in Color Picker, but that&#8217;s not a color picker! It&#8217;s an approved color picker. So I create a TRUE [...]]]></description>
			<content:encoded><![CDATA[<p>This package will create a DataType called &#8220;True Color Picker&#8221;.<br />
You may be wondering, what&#8217;s &#8220;True&#8221; doing there?<br />
Well I was looking for a color picker without the need to provide pre-defined colors.<br />
I saw the built-in Color Picker, but that&#8217;s not a color picker! It&#8217;s an approved color picker.<br />
So I create a TRUE color picker.</p>
<p>This package will create the following files / directories:</p>
<p>/umbraco/css<br />
    colorpicker.css<br />
/umbraco/js/colorpicker<br />
    colorpicker.js<br />
/umbraco/images/colorpicker<br />
    *</p>
<p>Link: <a href="http://our.umbraco.org/projects/true-color-picker">http://our.umbraco.org/projects/true-color-picker</a> </p>
<p>Screenshot:</p>
<p><a href="http://our.umbraco.org/media/wiki/6320/633936666357056677_true-color-picker-screenshot.png"><img class="alignnone" title="True Color Picker" src="http://our.umbraco.org/media/wiki/6320/633936666357056677_true-color-picker-screenshot.png" alt="" width="340" height="240" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://tech.kipusoep.nl/2009/11/13/true-color-picker-for-umbraco/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Ajax Control Toolkit 30390 for Umbraco</title>
		<link>http://tech.kipusoep.nl/2009/11/05/ajax-control-toolkit-30390-for-umbraco/</link>
		<comments>http://tech.kipusoep.nl/2009/11/05/ajax-control-toolkit-30390-for-umbraco/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 16:52:13 +0000</pubDate>
		<dc:creator>kipusoep</dc:creator>
				<category><![CDATA[Umbraco]]></category>

		<guid isPermaLink="false">http://tech.kipusoep.nl/?p=18</guid>
		<description><![CDATA[I modified the Ajax Control Toolkit version 30390 so it can be used next to Umbraco&#8217;s ACT version. Look at http://our.umbraco.org/projects/ajaxcontroltoolkit-30930-for-umbraco]]></description>
			<content:encoded><![CDATA[<p>I modified the Ajax Control Toolkit version 30390 so it can be used next to Umbraco&#8217;s ACT version.</p>
<p>Look at <a href="http://our.umbraco.org/projects/ajaxcontroltoolkit-30930-for-umbraco" target="_blank">http://our.umbraco.org/projects/ajaxcontroltoolkit-30930-for-umbraco</a></p>
]]></content:encoded>
			<wfw:commentRss>http://tech.kipusoep.nl/2009/11/05/ajax-control-toolkit-30390-for-umbraco/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

