<?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:rssdatehelper="urn:rssdatehelper"><channel><title>Percipient Blog</title><copyright>Copyright 2009, Percipient Studios. All rights reserved.</copyright><link>http://blog.percipientstudios.com</link><pubDate></pubDate><generator>umbraco</generator><description></description><image><url>http://blog.percipientstudios.com/images/logo-brand-blog-55.png</url><title>Percipient Blog</title><link>http://blog.percipientstudios.com</link></image><language>en</language><item><title>UmbracoMan: Being a Superhero</title><link>http://blog.percipientstudios.com/2013/5/9/umbracoman-being-a-superhero.aspx</link><pubDate>Thu, 09 May 2013 15:46:25 GMT</pubDate><guid>http://blog.percipientstudios.com/2013/5/9/umbracoman-being-a-superhero.aspx</guid><description>
&lt;p&gt;Content editors need a superhero. UmbracoMan is that hero!&lt;/p&gt;

&lt;p&gt;Learn how to be a superhero to your users in this helpful and
entertaining presentation deliverd at the #umbDkFest on
12-April-2013 in Aarhus, Denmark.&lt;/p&gt;
</description><author>info@percipientstudios.com (Douglas Robar)</author><content:encoded><![CDATA[ <h2>Why Be a Superhero?</h2>

<p>I'm known as an advocate for users and speak about it extensively in all the <a href="http://www.percipientstudios.com/training.aspx">Umbraco Level 1 courses I teach</a> 
as well as <a href="http://24days.in/umbraco/2012/superhero/">online</a>.</p>

<p>In my experience it's easy to build Umbraco websites in a way that content editors will love! 
And.. without sacrificing any of the freedom and fun we enjoy when developing umbraco sites.</p>

<p>So when <a href="https://twitter.com/jskovgaard">Jan Skovgaard</a> invited me to be the special guest speaker at the Umbraco DK Festival in Aarhus, Denmark by saying,    
<em>"it would be nice with some focus on how to be a super hero to your users, since that's also our mantra in the solutions we build. We focus a lot on making the job of the editor as easy as possible."</em> 
I couldn't resist!</p>



<h2>
Content editors need a superhero.<br />
UmbracoMan is that hero!
</h2>
<p>
&nbsp;<br />
<img src="http://blog.percipientstudios.com/media/6405/umbracoman.jpg" alt="UmbracoMan" />
<br />
</p>


<h2>How to Become a Superhero?</h2>
<p>See my presentation with full transcript notes below:</p>

<p><a href="http://blog.percipientstudios.com/media/6402/becoming_a_superhero-umbraco_dk_festival_2013-notes.pdf">Download the PDF</a></p>

<div>
<iframe src="http://www.slideshare.net/slideshow/embed_code/20802318" width="555" height="592" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" style="border:1px solid #CCC;border-width:1px 1px 0;margin-bottom:5px" allowfullscreen webkitallowfullscreen mozallowfullscreen> </iframe> <div style="margin-bottom:5px"> <strong> <a href="http://www.slideshare.net/PercipientStudios/becoming-a-superhero-umbraco-dk-festival-2013-notes" title="Becoming a superhero - Umbraco DK festival 2013 - notes" target="_blank">Being a superhero - Umbraco DK festival 2013 - notes</a> </strong> from <strong><a href="http://www.slideshare.net/PercipientStudios" target="_blank">Douglas Robar</a></strong> </div>
</div>
<p>&nbsp;</p>


<h2>Thank you, Kraftvaerk!</h2>
<p>I'd like to thank <a href="http://www.flickr.com/photos/percipientstudios/8656760097/">the team</a> at <a href="http://kraftvaerk.net">Kraftvaerk</a> for inviting me to #umbDkFest!</p>  
<p>The venue, presentations, food, t-shirts, swag, <em>everything</em> even down to the smallest detail about the day was perfect! 
And with 150 Umbracians to talk to I enjoyed every minute.
It was an awesome day! Thank you!<br /></p>

<h2>Photos</h2>
<p>As an added bonus, I got to shoot alongside my friend and fellow photographer <a href="https://twitter.com/steinmeier/">Niels Steinmeier</a>.</p> 
<p>Check out our photos of #umbDkFest at:
<ul>
<li>
<a href="http://www.flickr.com/photos/steinmeier/sets/72157633248476958/">http://www.flickr.com/photos/steinmeier/sets/72157633248476958/</a>
</li>
<li>
<a href="http://www.flickr.com/photos/percipientstudios/sets/72157633262945505/">http://www.flickr.com/photos/percipientstudios/sets/72157633262945505/</a>
</li>
</ul>
</p>


<p>&nbsp;<br />
cheers,<br />doug.</p>
]]></content:encoded></item><item><title>Umbraco Courier from the Command Line</title><link>http://blog.percipientstudios.com/2012/10/3/umbraco-courier-from-the-command-line.aspx</link><pubDate>Wed, 03 Oct 2012 09:35:57 GMT</pubDate><guid>http://blog.percipientstudios.com/2012/10/3/umbraco-courier-from-the-command-line.aspx</guid><description>
&lt;p&gt;Based on real-world experience with Courier 2, here's a quick
guide to getting the command-line extraction console running.
Includes important background and&amp;nbsp;installation , execution,
and error review steps.&lt;/p&gt;
</description><author>info@percipientstudios.com (Douglas Robar)</author><content:encoded><![CDATA[ <h2>Using the Courier Extraction Console</h2>
<p><em>Courier 2.7 was current at the time of this writing</em></p>
<p>There are two parts to Courier: packaging and extracting. Both parts are available from the Courier section of the Umbraco backoffice interface as well as by right-clicking on items within the various trees of the backoffice.</p>
<p>There is also a command-line extraction tool. Its primary purpose is to allow automation of Courier activity as part of your Visual Studio project's build events, or from your build server. You develop locally and upon building your project your changes to datatypes, macros, templates, content, etc. can be loaded into a staging or QA site and automated unit tests run. Very slick.</p>
<p>You can find out more about this in the <a href="http://stream.umbraco.org/video/2087970/codegarden-11-keynote">Umbraco Codegarden 11 Keynote</a> video (at about 43 minutes in) and the <a href="http://stream.umbraco.org/video/2198253/team-development-with-courier">Team Development using Courier</a> session by Per. Both are highly recommended viewing.</p>

<h2>Installing</h2>
<p>The extraction console application (and source) is available from <a href="https://github.com/umbraco/Courier/tree/master/Samples/Umbraco.Courier.ExtractionConsole">https://github.com/umbraco/Courier/tree/master/Samples/Umbraco.Courier.ExtractionConsole</a>.</p>
<ol>
<li>Copy the executable and associated dlls to some location. Personally, I copy into the site's ~/bin folder but that may not be required. You'll also end up with a ~/bin/plugins folder containing associated dlls. Additional information at <a href="http://our.umbraco.org/forum/umbraco-pro/courier/21756-Has-anyone-managed-to-get-Courier-working-with-the-command-line-tool">http://our.umbraco.org/forum/umbraco-pro/courier/21756-Has-anyone-managed-to-get-Courier-working-with-the-command-line-tool</a>. </li>
<li>Copy the ~/config/courier.config file to the extraction console's folder (~/bin in this example). Also copy it to the ~/bin/plugins folder. I'm not sure which folder contains the config file that is used but it definitely uses a local copy of the config file rather than the site's copy used by the Umbraco backoffice, thus allowing multiple config files to be used with the command line extraction console.</li>
<li>If not already done, create 'revisions' for each of the parts of the original site (datatypes, doctypes, macros, templates, media, document, etc. as noted elsewhere) using the backoffice. These revisions will be stored in the ~\App_Data\courier\revisions\revision_name folders.</li>
</ol>
<h2>Run from the Command Prompt</h2>
<ol>
<li>Once the packaging of the revisions is complete, open a command prompt. I don't know if it matters, but to be on the safe side I always run it from a command prompt that has 'run as Administrator' enabled.</li>
<li>Change directory to the desired revision and launch the extraction console:<br />
<br />
Command prompt:<br />
<pre class="brush: xml;">
..\..\..\..\bin\Umbraco.Courier.ExtractionConsole.exe
</pre></li>
<li>You should see a dependency graph being created with more than zero items (if it is zero items you may not have a valid revision or be in the correct revision folder)</li>
<li>Press the 'Y' key to continue</li>
<li>When prompted for the 'Website to connect to?' enter the 'alias' of the site as noted in the local courier.config file.</li>
</ol>

<h2>Identifying Errors</h2>
<p>Be sure to turn on all logging in the config file. This will not slow down Courier appreciably, even for very large runs.</p>
<p>Log files will be saved in the ~\App_Data\courier\revisions\revision_name\app_data\courier\logs folder. Always review them as important issues may appear there that may not appear in the console window itself.</p>
]]></content:encoded></item><item><title>Using XSLTsearch with CWS</title><link>http://blog.percipientstudios.com/2012/7/23/using-xsltsearch-with-cws.aspx</link><pubDate>Mon, 23 Jul 2012 12:45:19 GMT</pubDate><guid>http://blog.percipientstudios.com/2012/7/23/using-xsltsearch-with-cws.aspx</guid><description>
&lt;p&gt;Garrett Fisher wanted to replace the Examine search used by CWS
with XSLTsearch. In less than 10 minutes you'll have a fully
customized search running in CWS. Let me show you how.&lt;/p&gt;
</description><author>info@percipientstudios.com (Douglas Robar)</author><content:encoded><![CDATA[         <p>Warren Buckley's excellent <a href="http://our.umbraco.org/projects/starter-kits/creative-website-starter-(cws)/">Creative Website Starter (CWS)</a> is a great way to get started with Umbraco, allowing you to see how a finished site is constructed. In 2012 CWS was updated to use the built-in "Examine" search engine in Umbraco 4.7.</p>
        
        <p>As powerful as Examine is (it's built on top of Lucene.Net), it isn't always convenient to get up and running quickly. <a href="http://our.umbraco.org/projects/website-utilities/xsltsearch/xsltsearch-bugs/18011-How-to-reference-XSLTsearch-in-my-page?p=1#comment122628">Garrett Fisher asked how to use XSLTsearch instead</a>. Let me show you how to do it.</p>
        
        <h2>How to do it</h2>
        <p>I'll assume that you have CWS installed already, and have also installed the <a href="http://our.umbraco.org/projects/website-utilities/xsltsearch">XSLTsearch package</a>. Because CWS already has almost everything we need we really only need to modify the original template to use the XSLTsearch macro</p>
        <ul>
            <li>In the <strong>Settings section</strong>, open the <strong>XSLTsearch</strong> template. Copy the &lt;umbraco:Macro ...>&lt;/umbraco:Macro> lines to the clipboard.</li>
            <li>Now open the <strong>Search (only called with template alias)</strong> template and delete the existing &lt;umbraco:Macro runat="server" Alias="CWS_ExamineSearch" /> line.</li>
            <li><strong>Paste</strong> in the XSLTsearch macro from the clipboard in its place.</li>
            <li><strong>Save</strong> the template.</li>
        </ul>
        <p>The updated template should now look like this:</p>
        <pre class="brush: xml;">&lt;%@ Master Language="C#" MasterPageFile="~/masterpages/CWS_Master.master" AutoEventWireup="true" %>

&lt;asp:content ContentPlaceHolderId="headerLinksContent" runat="server">  
&lt;/asp:content>

&lt;asp:content ContentPlaceHolderId="SideBarContent" runat="server">  
&lt;/asp:content>

&lt;asp:content ContentPlaceHolderId="ChildContent" runat="server">
    &lt;div id="main" class="content oneCol left clearfix" role="main">
      &lt;umbraco:Macro runat="server" Alias="XSLTsearch"
        macroAlias="XSLTsearch"
        source="-1"
        searchFields="@nodeName,metaKeywords,metaDescription,bodyText"
        previewFields="bodyText,metaDescription"
        previewType="beginning"
        searchBoxLocation="none"
        resultsPerPage="5"
        previewChars="255"
        showPageRange="0"
        showOrdinals="0"
        showScores="0"
        showStats="1">
      &lt;/umbraco:Macro>
  &lt;/div>
&lt;/asp:content></pre>
        

        <h2>Making it even better</h2>
        <p>By default, XSLTsearch will automatically look within the common document type properties. CWS has additional properties we should also search within. We can also stop displaying the search box on the results page since the site's banner has a search box already in it. Thus, we will make the following changes to the XSLTsearch macro parameters found on the Search template we edited a moment ago.</p>
        <p>The <a href="http://our.umbraco.org/projects/website-utilities/xsltsearch">XSLTsearch documentation</a> (PDF) explains all the parameters in detail so I'll just show you the finished result. Every XSLTsearch user should look over the documentation to get the most out it and customize it to their needs.</p>
        <pre class="brush: xml;">searchFields="@nodeName,metaKeywords,metaDescription,headerText,bodyText,bodyTextColOne,bodyTextColTwo,photoText,formText"

previewFields="formText,photoText,bodyTextColTwo,bodyTextColOne,bodyText,headerText,metaDescription"

searchBoxLocation="none"</pre>
        <p>The fully updated macro should now contain the following parameters:</p>
        <pre class="brush: xml;">&lt;umbraco:Macro runat="server" Alias="XSLTsearch"
    macroAlias="XSLTsearch"
    source="-1"
    searchFields="@nodeName,metaKeywords,metaDescription,headerText,bodyText,bodyTextColOne,bodyTextColTwo,photoText,formText"
    previewFields="formText,photoText,bodyTextColTwo,bodyTextColOne,bodyText,headerText,metaDescription"
    previewType="beginning"
    searchBoxLocation="none"
    resultsPerPage="5"
    previewChars="255"
    showPageRange="0"
    showOrdinals="0"
    showScores="0"
    showStats="1">
&lt;/umbraco:Macro></pre>
        
        
        
        <h2>Tidying up</h2>
        <p>Because we are using everything except the XSLTsearch macro we can delete the unused bits.</p>
        <ul>
            <li>Delete the <strong>Search page</strong> from the Content section</li>
            <li>Delete the <strong>XSLTsearch template</strong> from the Settings section</li>
            <li>Delete the <strong>XSLTsearch document type</strong> from the Settings section</li>
        </ul>
        <p>And that's all there is to it!</p>]]></content:encoded></item><item><title>When Less is More</title><link>http://blog.percipientstudios.com/2012/6/19/when-less-is-more.aspx</link><pubDate>Tue, 19 Jun 2012 05:08:43 GMT</pubDate><guid>http://blog.percipientstudios.com/2012/6/19/when-less-is-more.aspx</guid><description>
&lt;p&gt;Learn the key differences between v4 and v5 in my &quot;&lt;strong&gt;When
Less is More&lt;/strong&gt;&quot; presentation, given at Umbraco Codegarden
12.&lt;/p&gt;

&lt;p&gt;For those who learned version 5, this presentation shows you
what you need to know about version 4. By the end I think you'll
agree that Umbraco 4 is a great product that meets real-world
needs.&lt;/p&gt;
</description><author>info@percipientstudios.com (Douglas Robar)</author><content:encoded><![CDATA[ <p>As you'll know, <a href="http://umbraco.com/follow-us/blog-archive/2012/6/13/v5-rip.aspx">Umbraco 5 was retired</a> at the annual Umbraco Codegarden conference during <a href="http://umbraco.com/follow-us/blog-archive/2012/6/13/cg12-keynote-video.aspx">the keynote address</a>.</p>

<h3>For people who learned v5 only</h3>
<p><strong>This is an overview of what's different in version 4, from a v5 perspective</strong>.</p>

<p>The core concepts of document types, templates and razor logic are the same in both versions but there are differences you'll want to know about, along with what is better in each version (in my opinion).</p>

<p>Having taught the <a href="http://umbraco.com/products/training/schedule.aspx">Umbraco Level 1 Certification Course</a> in the USA and UK with v2, 3, 4, and 5 my view is that Umbraco 4 is currently the version that best meets real-world needs.</p>

<h2>On with the show</h2>
<p>Master the similarities and differences between v4 and v5, pick up best practices and hidden gems (and even some umbraco folklore too). Ideal for anyone who hasn't used v4.</p>

<div><strong><a href="http://codegarden12.com/sessions/day-two/slot-five/when-less-is-more.aspx">Watch the video</a></strong>
<br />
<a href="http://codegarden12.com/sessions/day-two/slot-five/when-less-is-more.aspx">
<img src="http://blog.percipientstudios.com/media/6346/screen%20shot%202012-06-20%20at%2010.21am.png" />
</a>
</div>
<p>Or download it here: <a href="http://stream.umbraco.org/4959050/6426192/19abf5ebc0b1c2ca3744bcfba68eb23c/video_hd/when-less-is-more-video.mp4">When Less is More</a>(mp4)</p>

<div style="width:557px" id="__ss_13379229"><strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/PercipientStudios/when-less-is-more-13379229" title="When Less is More">View the slide deck</a></strong><object id="__sse13379229" width="557" height="635"><param name="movie" value="http://static.slidesharecdn.com/swf/doc_player.swf?doc=v5to4-slidedeck-djr-120619073203-phpapp02&stripped_title=when-less-is-more-13379229&userName=PercipientStudios" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><param name="wmode" value="transparent"/><embed name="__sse13379229" src="http://static.slidesharecdn.com/swf/doc_player.swf?doc=v5to4-slidedeck-djr-120619073203-phpapp02&stripped_title=when-less-is-more-13379229&userName=PercipientStudios" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" wmode="transparent" width="557" height="635"></embed></object></div>

<p>Or download it here: <a href="http://blog.percipientstudios.com/media/6319/v5to4-slidedeck-djr.pdf">When Less is More</a>(pdf)</p>]]></content:encoded></item><item><title>How To: ImageGen 2.5 with Umbraco 5</title><link>http://blog.percipientstudios.com/2012/2/1/how-to-imagegen-25-with-umbraco-5.aspx</link><pubDate>Wed, 01 Feb 2012 11:55:53 GMT</pubDate><guid>http://blog.percipientstudios.com/2012/2/1/how-to-imagegen-25-with-umbraco-5.aspx</guid><description>
&lt;p&gt;Learn how to use your old friend ImageGen 2.5 with the brand
spanking new Umbraco v5. It's quick, simple, and very powerful!&lt;/p&gt;
</description><author>info@percipientstudios.com (Douglas Robar)</author><content:encoded><![CDATA[    <p>
        Did you know that ImageGen isn't only for Umbraco sites? That's right, you can use ImageGen with <em>any</em>
        .net 2.0 (or higher) website because it isn't tied to any specific Umbraco version.</p>
    <p>
        So... does that mean I can you use the same ImageGen that I've enjoyed using with my Umbraco 4 sites with
        the all new, mvc-based Umbraco 5?<br />
        <strong>YES!</strong></p>
    <p>
        <em><strong>Disclaimer:</strong> these steps are a workaround until I get an updated
            version of ImageGen released that properly supports Umbraco 5's plugin architecture.
            When that's released you'll be able to install the package directly and not worry
            about this blog post. Okay? Okay.</em></p>
    <h2>
        Manual Installation</h2>
    <ol>
        <li>Download the ImageGen .zip package created for Umbraco v4<br />
            <a href="http://our.umbraco.org/projects/website-utilities/imagegen">http://our.umbraco.org/projects/website-utilities/imagegen</a>
        </li>
        <li>Extract the .zip file to a temporary folder</li>
        <li>View the expanded files and copy the following files to your Umbraco v5.0 website<br />
            <ul>
                <li>ImageGen.ashx goes in the root of your site</li>
                <li>ImageGen.config goes in the root of your site</li>
                <li>ImageGen.dll goes in the 'bin' folder of your site</li>
            </ul>
        </li>
        <li>Update the Web.config file in the root of your site to add the lines that have ImageGen in them:<br />
            <pre class="brush: xml;">
 &lt;configuration&gt;
   &lt;configSections&gt;
      &lt;section name=&quot;ImageGenConfiguration&quot; type=&quot;ImageGen.ImageGenConfigurationHandler,ImageGen&quot; /&gt;
   &lt;/configSections&gt;

   &lt;ImageGenConfiguration configSource=&quot;ImageGen.config&quot; /&gt;
&lt;/configuration&gt;
</pre>
        </li>
        <li>Verify the installation by viewing <a href="http://localhost/imagegen.ashx?version">
            http://localhost/imagegen.ashx?version</a>
            <br />
            (replacing localhost with your site's domain and/or port number)<br />
            <br />
            You should see a result like the following:<br />
            <br />
            <em>ImageGen Professional version 2.5.7.27945<br />
                Professional features are available for localhost<br />
                Professional features are available for *.local<br />
            </em></li>
    </ol>
    <h2>
        Razor Code for using ImageGen</h2>
    <p>
        You can use this same Razor code in a macro or directly in your template.</p>
    <p>
        For these examples I've created two document type properties. One is an Uploader
        field and the other is a Media Picker. Since they behave slightly differently it's
        worth seeing both.</p>
    <h3>
        Using ImageGen with an Uploader property called uploadImage</h3>
    <pre class="brush: xml;">
 &lt;p&gt;Original image:&lt;br /&gt;
   &lt;img src=&quot;@Umbraco.GetMediaUrl(Model.Id, &quot;uploadImage&quot;)&quot; width=&quot;200&quot; /&gt;
&lt;/p&gt;

&lt;p&gt;Resized image:&lt;br /&gt;
   &lt;img src=&quot;/imagegen.ashx?width=200&image=@Umbraco.GetMediaUrl(Model.Id, &quot;uploadImage&quot;)&quot; /&gt;
&lt;/p&gt;
</pre>
    <h3>
        Using ImageGen with a MediaPicker property called mediaImage</h3>
    <pre class="brush: xml;">
 &lt;p&gt;Original image:&lt;br /&gt;
   &lt;img src=&quot;@Umbraco.GetMediaUrl(DynamicModel.MediaImage, &quot;uploadedFile&quot;)&quot; width=&quot;200&quot; /&gt;
&lt;/p&gt;

&lt;p&gt;Resized image:&lt;br /&gt;
   &lt;img src=&quot;/imagegen.ashx?width=200&image=@Umbraco.GetMediaUrl(DynamicModel.MediaImage, &quot;uploadedFile&quot;)&quot; /&gt;
&lt;/p&gt;
</pre>
    <p>
        <strong>Tip: </strong>for more elaborate Razor macro inspriation, check out Warren
        Buckley's GitHub collection of snippets at <a href="https://gist.github.com/warrenbuckley">
            https://gist.github.com/warrenbuckley</a></p>
    <h2>
        Remote, Cloud, and Non-Local Images</h2>
    <p>
        The above works perfectly for images stored locally. If your images aren't stored
        locally on the web server it won't work.</p>
    <p>
        But... <strong>ImageGen Professional's "Remote Images" saves the day!</strong></p>
    <p>
        You just need to include the full url to the image in your call to ImageGen.ashx,
        and update the ImageGen.config file to whitelist your domain(s) to make it work.
        The <a href="http://our.umbraco.org/projects/website-utilities/imagegen">ImageGen Reference
            Manaul</a> explains whitelisting and remote urls.</p>
    <p>
        As an added benefit, with ImageGen Professional you can turn on client-side image
        caching, which can greatly improve the performance of your site, especially with
        remote images that might have some latency in fetching.</p>
    <p>
        ImageGen Professional's remote image capability works for images served from a remote
        website (flickr, twitter, etc.), those stored in the cloud (EC2, Amazon, etc.),
        saved as blobs in a database, and with all future Hive providers. With ImageGen
        Professional you can rock them all.</p>
    <p>
        &nbsp;</p>
    <p>
        ...and that's all there is to it!</p>]]></content:encoded></item><item><title>Help, I need my passport back</title><link>http://blog.percipientstudios.com/2011/6/1/help,-i-need-my-passport-back.aspx</link><pubDate>Wed, 01 Jun 2011 10:53:17 GMT</pubDate><guid>http://blog.percipientstudios.com/2011/6/1/help,-i-need-my-passport-back.aspx</guid><description>
&lt;p&gt;In order to travel to the annual CodeGarden conference I need my
visa application approved and passport returned from the UK Home
Office Border Agency within the next two weeks.&lt;/p&gt;

&lt;p&gt;Update: Your help has returned my passport in time!&lt;/p&gt;
</description><author>info@percipientstudios.com (Douglas Robar)</author><content:encoded><![CDATA[ <h2>The short of it</h2>

<p><strong>In order to travel to the annual CodeGarden conference I
need my visa application approved and passport returned from the UK
Home Office Border Agency within the next week.</strong></p>

<p><del><a href="#help">Yes, you can help!</a></del></p>
<p>We now have an <a href="#answer">answer</a></p>

<p><strong>I am requesting an expedited decision of my case, now
two months old.</strong></p>

<p>Applicant: Douglas James Robar<br />
Case Ref: 014264466</p>

<p>&nbsp;</p>

<h2>The long of it</h2>

<p>I'm an <strong>American living in Cambridge</strong> UK for 2.5
years. My wife is a PhD student at Cambridge University and has a
student visa. I have a student dependant visa that allows me to
work in the UK.</p>

<p><strong>I own and run <a
href="http://www.percipientstudios.com">Percipient
Studios</a></strong>. Not only do I offer website design and
implementations using the Umbraco CMS, I am also the only official
Umbraco Level 1 Trainer in the UK and have taught hundreds of UK
software developers, webmasters, and IT staff attain the valuable
<a
href="http://umbraco.com/certified-partners/find-a-certified-developer">
Umbraco Certified Developer</a> certification and tens of
organisations become <a
href="http://umbraco.com/certified-partners/browse-solution-providers">
Umbraco Solution Providers</a>.</p>

<p>I like being in the UK. My family and I would like to stay for
some time even after my wife finishes her PhD. And I want to
continue my business here.</p>

<p>For this I need a new visa and have <strong>applied for a <a
href="http://www.ukba.homeoffice.gov.uk/workingintheuk/tier1/general/">
Tier 1 General</a> visa</strong>. I fully qualify according to that
points-based system, provided all needed documentation and
biometric evidence, and even used the excellent <a
href="http://www.globalvisas.com/">Global Visas</a> to ensure a
flawless application. My application was delivered before the
deadline of 4-April (<strong>two months ago</strong>).</p>

<p>In mid-June I am to give a <a
href="http://codegarden11.com/sessions/day-2/slot-one/did-you-know.aspx">
presentation</a> at the annual Umbraco conference, <a
href="http://codegarden11.com/">CodeGarden</a>, and will also be
moderating a panel discussion. CodeGarden (twitter: <a
href="http://twitter.com/#!/search/%23CG11">#CG11</a>) is
<strong>the single most important event of the year for my
business</strong>; I get work as a direct result of attending in
addition to its being a key source for my own professional
development in the field.</p>

<p>Though the Home Office suggests that <a
href="http://www.ukba.homeoffice.gov.uk/workingintheuk/tier1/general/waitingtimes/">
75% of cases are decided within four weeks</a>, my case is still
outstanding after 8 weeks.</p>

<p>I need a miracle. The Home Office won't discuss my case with me
until <a
href="http://www.ukba.homeoffice.gov.uk/while-in-uk/travel-abroad/traveldocuments/applying/waitingtimes/">
14 weeks have passed</a>. I've called. Multiple times. It will only
(only?) have been ten weeks by the time CodeGarden begins. But
<strong>without my approved visa and passport returned I can't
leave the country</strong>.</p>

<p>I had thought of getting an emergency second passport from the
US Embassy in London (which they can do within 36 hours). But have
found out from the Home Office that if I leave the UK before my
visa has been issued, even on a valid passport, my visa application
will automatically and immediately be cancelled.</p>

<p>&nbsp;</p>

<h2>Updates</h2>
<h3>25-May</h3>

<p>At the Home Office's recommendation I have faxed a request for
urgency to 0114 207 2536. I was told that no reply to my request
will be given and no assurance can be made of fulfilling my request
for urgency. Also at the HO's recommendation my fax included the
important "do not withdraw my application" sentence. I'm not sure
why this should be necessary but twice I was told it should appear
on the fax.</p>

<h3>1 June</h3>

<p>Blog post and tweet to escalate issue in the hope that something
can be done to ensure I will be able to attend the CodeGarden
conference.</p>

<p>UPDATE: I contacted my local MP (<a title="Julian Huppert"
href="http://www.julianhuppert.org.uk/">Julian Huppert</a>, twitter
<a title="@julianhuppert"
href="http://twitter.com/#!/julianhuppert">@julianhuppert</a>) at
the recommendation of many and his office was very responsive. They
called me back within two hours with the news that "You will be
pleased to know your application is nearing the end of the review
process and you will be hearing shortly." I then asked when
"shortly" might be. "If you have not heard from UKBA by Sunday 12th
June please do contact Julian again."</p>

<h3>2 June</h3>

<p>Potentially hearing something by 12 June is not sufficient - I
would then still need to wait to receive my passport by post.
<strong>I am still looking for assistance to successfully complete
my visa application and return my passport (in my hands) by 9
June</strong>. That's only one week away.</p>

<p>Others have suggested these avenues, which I will be following
up on:</p>

<ul>
<li>"Contact the US Embassy Consular Affairs section and have them
intervene on his behalf. They are the only outsiders with enough
juice to make it happen."</li>

<li>Continue tweeting and include <a title="@UKBorderAgency_"
href="http://twitter.com/#!/UKBorderAgency_/">@UKBorderAgency_</a>
<a title="@UKBAinUSA"
href="http://twitter.com/#!/UKBAinUSA/">@UKBAinUSA</a> and possibly
others.</li>

<li>Contact Jim Paice, MP for SE Cambs and somehow involved with
the UK Border Agency.</li>

<li><em>If you have other suggestions please leave them in the
comments!</em></li>
</ul>

<p>UPDATE: <a
href="http://www.benjaminhowarth.com">Benjamin Howarth</a> has
contacted his MP and discovered <em>&quot;<strong>MPs have access routes to
the UK Passport Agency that are not available to the
public</strong>, so Julian Huppert is your best bet.
<strong>Letters of commercial support as well are also
helpful</strong> apparently, so I sorted a petition for you: <a
href="http://www.petitiononline.com/drobar11/petition.html">http://www.petitiononline.com/drobar11/petition.html</a>&quot;</em></p>

<h3>3 June</h3>

<p>The volume of <a
href="http://www.petitiononline.com/mod_perl/signed.cgi?drobar11">petition
signatures</a> (currently 140 signatures!), tweets, retweets, and
outpouring of concern and support is overwhelming. Thank you!</p>

<p>I've emailed my MP again and am awaiting a response. I'll keep
you posted, and as ever please accept my deep thanks and let me
know if you or someone you know can assist in expediting the
approval and return of my visa application and passport.</p>

<h3>4 June</h3>

<p><strong>Things seem to be moving!</strong></p>
<p>I received this note from Julian Huppert's office today:<br />
<em>&quot;I have been in touch with the UK Border Agency about the need for Doug
to receive the determination of his visa application and passport
returned. <strong>The issue has been referred to the Border Agency MP Account
Managers Office. I will contact them again first thing on Monday
morning and let you know the outcome.</strong>&quot;</em>
</p>

<h3>6 June</h3>
<p>So far there are <a 
href="http://www.petitiononline.com/mod_perl/signed.cgi?drobar11">177 
signatures on the petition</a>, thank you!</p>

<p>&nbsp;</p>

<h2 id="help">Please help</h2>

<p><del>If you know anyone at the Home Office or Border Agency I
would greatly appreciate your assistance.</del></p>

<p><del>Please sign my petition at <a
href="http://www.petitiononline.com/drobar11/petition.html">http://www.petitiononline.com/drobar11/petition.html</a>.</del></p>

<p><del>Email a personal recommendation to my MP, <a
href="mailto:julianhuppertmp@gmail.com?subject=Recommendation for Douglas Robar's visa application">
Julian Huppert</a> to give urgency to Douglas Robar's visa
application.</del></p>

<p>We now have an <a href="#answer">answer</a>.</p>


<h2 id="answer">Good and bad news</h2>
<p>I just heard from from Julian Huppert's office, who have been 
tremendously helpful. There is good news and bad news:</p>
<ul>
<li><strong>Good news = My passport will be dispatched today!</strong></li>
<li>Bad news = my Tier 1 General visa application was denied</li>
</ul>
<p>This means I can attend CodeGarden! And my existing visa is still in force 
so I can stay and work in the UK until my wife completes here PhD sometime 
in the next year.</p>
<p>I have hugely mixed emotions right now. On the one hand I am disappointed 
in the visa decision (I'll find out the reason when I receive the paperwork via post
in a few days). On the other hand <strong>I'm overwhelmed by all for your efforts, good wishes, and prayers!</strong> How could one man be blessed with so many great friends and colleagues?</p>

<p>&nbsp;</p>


<p>Thank you!<br />
doug.</p>

<p>&nbsp;</p>
]]></content:encoded></item><item><title>How To: Umbraco Razor Intellisense and Debugging</title><link>http://blog.percipientstudios.com/2011/3/3/how-to-umbraco-razor-intellisense-and-debugging.aspx</link><pubDate>Thu, 03 Mar 2011 10:55:40 GMT</pubDate><guid>http://blog.percipientstudios.com/2011/3/3/how-to-umbraco-razor-intellisense-and-debugging.aspx</guid><description>
&lt;p&gt;With Umbraco 4.7, Razor just might be the go-to language for
most macros from now on. Unfortunately, even with Visual Studio
2010, intellisense was missing for @Model, the single most
important part of a Razor macro.&lt;/p&gt;

&lt;p&gt;This short video demonstrates how you can get some intellisense
love for your Umbraco Razor macros. I also show you how easy it is
to debug Razor macros without compiling any code.&lt;/p&gt;
</description><author>info@percipientstudios.com (Douglas Robar)</author><content:encoded><![CDATA[ <h2>Razor, a new Umbraco macro language</h2>

<p><a href="http://umbraco.codeplex.com/releases/view/59502">Umbraco 4.7 RC</a> has an all-new <a href="http://umbraco.com/follow-us/blog-archive/2011/3/1/umbraco-razor-feature-walkthrough-%E2%80%93-part-4">Razor macro engine</a>, a foretaste of the coming MVC goodness of <a href="http://umbraco.com/follow-us/blog-archive/2010/11/26/umbraco-5-may-the-blogging-commence">Umbraco 5</a>.</p>

<p>As everyone knows, I'm an XSLT fanboy; it is lightning quick, powerful, an open standard, and I don't have to open a Visual Studio solution every time I want to make a minor change. Besides, my C# skills aren't amazing. Thankfully with Umbraco, I don't need to be a .NET guru.</p>

<p>I've always been a little uncomfortable with how wide the gap is between XSLT and .NET macros though. With Razor, we may have found the middle ground. Razor just might be the go-to language for most macros from now on, though I'll need more time with Razor to know for sure.</p>

<h2>My first Razor project, RazorSearch</h2>
<p>As a first project I'm writing RazorSearch for Umbraco. Basically, I'm recreating the functionality of XSLTsearch by implementing it with Razor.</p>

<p>As some of you may know, XSLTsearch was originally written in Notepad. I don't want to repeat that terrible editing and debugging experience. I'd like to use something more helpful as I learn Razor.</p>

<h2>Visual Studio and (no) Intellisense</h2>
<p>I fired up Visual Studio 2010 Professional, opened my local website, and was hoping for a lot of intellisense magic to give me hints along the way.</p>

<p>But no.</p>

<p>Intellisense was missing for @Model. I (and a lot of other early adopters on twitter) wanted some helps. How can I get some intellisense love with dynamic objects that are not determined until runtime?</p>

<h2>Make Intellisense and Debugging Work</h2>
<p>Being easier to show you how to do it than write about it, here's a short video that demonstrates how to get as much Razor Intellisense for Umbraco 4.7 (RC) macros as I've been able to come up with so far.<p>

<p>As an added bonus, I also show how easy it is to debug Razor macros without having to compile the source. It's really easy!</p>

<iframe title="YouTube video player" width="435" height="275" src="http://www.youtube.com/embed/NgnKy-VTimU?rel=0" frameborder="0" allowfullscreen></iframe>

<p><a href="http://www.youtube.com/watch?v=NgnKy-VTimU&hd=1">Watch on YouTube</a></p>


<h2>Helpful Resources</h2>
<p>As you begin your Razor macro journey, you may find the following resources helpful. I sure have!</p>
<ul>

<li><a href="http://our.umbraco.org/wiki/reference/code-snippets/razor-snippets/dynamicnode-%28and-model%29-members-and-properties">@Model's (DynamicNode and DynamicNodeLis) Properties and Methods Reference</a></li>

<li><a href="http://our.umbraco.org/wiki/reference/code-snippets/razor-snippets">http://our.umbraco.org/wiki/reference/code-snippets/razor-snippets</a></li>



<li><a href="http://umbraco.com/follow-us/blog-archive/2011/9/22/umbraco-razor-feature-walkthrough%E2%80%93part-8.aspx">Razor feature walkthrough (part 8)</a></li>



<li><a href="http://umbraco.com/follow-us/blog-archive/2011/9/18/umbraco-razor-feature-walkthrough%E2%80%93part-7.aspx">Razor feature walkthrough (part 7)</a></li>


<li><a href="http://umbraco.com/follow-us/blog-archive/2011/9/15/umbraco-razor-feature-walkthrough%E2%80%93part-6.aspx">Razor feature walkthrough (part 6)</a></li>



<li><a href="http://umbraco.com/follow-us/blog-archive/2011/3/13/umbraco-razor-feature-walkthrough-part-5">Razor feature walkthrough (part 5)</a></li>

<li><a href="http://umbraco.com/follow-us/blog-archive/2011/3/1/umbraco-razor-feature-walkthrough-%E2%80%93-part-4">Razor feature walkthrough (part 4)</a></li>

<li><a href="http://umbraco.com/follow-us/blog-archive/2011/2/28/umbraco-razor-feature-walkthrough-%E2%80%93-part-3">Razor feature walkthrough (part 3)</a></li>

<li><a href="http://umbraco.com/follow-us/blog-archive/2011/2/24/umbraco-47-razor-feature-walkthrough-%E2%80%93-part-2.aspx">Razor feature walkthrough (part 2)</a></li>

<li><a href="http://umbraco.com/follow-us/blog-archive/2011/2/23/umbraco-47-razor-feature-walkthrough-%E2%80%93-part-1.aspx">Razor feature walkthrough (part 1)</a></li>


<li><a href="http://haacked.com/archive/2011/01/06/razor-syntax-quick-reference.aspx">Razor Syntax Quick Reference</a></li>

<li><a href="http://www.mikesdotnetting.com/Article/153/Inline-Razor-Syntax-Overview">Inline Razor Syntax Overview</a></li>

<li><a href="http://weblogs.asp.net/scottgu/archive/2010/07/02/introducing-razor.aspx">Introducing "Razor" - a new view engine for ASP.NET</a></li>

</ul>
]]></content:encoded></item><item><title>Quick and easy multi-lingual search pages for Umbraco sites</title><link>http://blog.percipientstudios.com/2010/11/17/quick-and-easy-multi-lingual-search-pages-for-umbraco-sites.aspx</link><pubDate>Wed, 17 Nov 2010 14:14:24 GMT</pubDate><guid>http://blog.percipientstudios.com/2010/11/17/quick-and-easy-multi-lingual-search-pages-for-umbraco-sites.aspx</guid><description>
&lt;p&gt;Searching within multi-lingual websites is simple with
XSLTsearch 3. Using Umbraco's convenient dictionary items and
language/culture capabilities you'll have multi-site,
multi-language searching in minutes.&lt;/p&gt;

&lt;p&gt;Here's a primer and &quot;how to&quot; guide to quickly set up XSLTsearch
in your multi-lingual website.&lt;/p&gt;
</description><author>info@percipientstudios.com (Douglas Robar)</author><content:encoded><![CDATA[ <p>Searching within multi-lingual websites is simple with
XSLTsearch 3. Using Umbraco's convenient dictionary items and
language/culture facility you'll have multi-site, multi-language
searching in minutes.</p>

<p>If you've never used the Umbraco dictionary capability before,
here's a primer and "how to" guide to quickly set up XSLTsearch in
your multi-lingual website. We'll cover the basics briefly and
focus on how to use XSLTsearch in an Umbraco installation with
multiple language sites.</p>

<p><em>You can find a more complete discussion of how to set up
multi-lingual websites in the umbraco.tv episodes about</em> <a
href="http://umbraco.tv/help-and-support/video-tutorials/umbraco-fundamentals/running-multiple-sites">
<em>Running Multiple Sites</em></a><em>.</em></p>

<p>&nbsp;</p>

<h2>Install XSLTsearch</h2>

<p>Install XSLTsearch from the Umbraco Package Repository, or by
first downloading it from <a
href="http://our.umbraco.org/website-utilities/xsltsearch">http://our.umbraco.org/website-utilities/xsltsearch</a>.</p>

<p><a
href="http://blog.percipientstudios.com/media/5406/WindowsLiveWriter_e124bd42ab2d_C0D0_install%20local%20package_2.png">
<img
style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px"
 title="install local package" border="0"
alt="install local package"
src="http://blog.percipientstudios.com/media/5411/WindowsLiveWriter_e124bd42ab2d_C0D0_install%20local%20package_thumb.png"
 width="277" height="390" /></a></p>

<p>&nbsp;</p>

<h2>Umbraco configuration steps</h2>

<h3>Add languages for your Umbraco installation</h3>

<p>Once XSLTsearch is installed, go to the Settings section of the
Umbraco back office administration interface, and expand the
Languages area. Here you'll see all the languages that your sites
will be able to use.</p>

<p>If your sites will need a language that isn't yet listed,
right-click on the Languages item and create a new language.</p>

<p><a
href="http://blog.percipientstudios.com/media/5416/WindowsLiveWriter_e124bd42ab2d_C0D0_languages-create_2.png">
<img
style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px"
 title="Create additional languages" border="0"
alt="Create additional languages"
src="http://blog.percipientstudios.com/media/5421/WindowsLiveWriter_e124bd42ab2d_C0D0_languages-create_thumb.png"
 width="277" height="234" /></a></p>

<p>Let's suppose we want to add German (as spoken in Germany) as a
language for one of our sites. Select "German (Germany)" from the
exhaustive list of languages and cultures:</p>

<p><a
href="http://blog.percipientstudios.com/media/5426/WindowsLiveWriter_e124bd42ab2d_C0D0_languages-german_2.png">
<img
style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px"
 title="Select your chosen language from the dropdown list"
border="0" alt="Select your chosen language from the dropdown list"
src="http://blog.percipientstudios.com/media/5431/WindowsLiveWriter_e124bd42ab2d_C0D0_languages-german_thumb.png"
 width="435" height="453" /></a>&nbsp;</p>

<p>We now have two languages available for use in our site, English
(United States) and German (Germany).</p>

<p><a
href="http://blog.percipientstudios.com/media/5436/WindowsLiveWriter_e124bd42ab2d_C0D0_languages-2langs_2.png">
<img
style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px"
 title="Umbraco shows the languages you have configured" border="0"
alt="Umbraco shows the languages you have configured"
src="http://blog.percipientstudios.com/media/5441/WindowsLiveWriter_e124bd42ab2d_C0D0_languages-2langs_thumb.png"
 width="276" height="234" /></a></p>

<p>You can add as many languages for as many sites in Umbraco as
you need following this same procedure.</p>

<h3>Create multiple sites in Umbraco</h3>

<p>It is best-practice to nest all your site's content beneath a
homepage. The wisdom of this practice is revealed when you want to
add another site to your Umbraco installation, as we will do
here.</p>

<p>For instance, you might have your public website, intranet, and
blog all in one Umbraco installation. Or perhaps you need to
present one site in a lot of different languages. Or even a
combination of both.</p>

<p>I'm going to assume you've got two sites set up similarly to
that shown below, two sites with one for each language. For
convenience, I have named each homepage with the two-letter culture
code (EN and DE).</p>

<p><a
href="http://blog.percipientstudios.com/media/5446/WindowsLiveWriter_e124bd42ab2d_C0D0_two-sites_2.png">
<img
style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px"
 title="Content structure showing two sites" border="0"
alt="Content structure showing two sites"
src="http://blog.percipientstudios.com/media/5451/WindowsLiveWriter_e124bd42ab2d_C0D0_two-sites_thumb.png"
 width="277" height="113" /></a></p>

<h3>Assign hostname, language, culture to each site</h3>

<p>Now that you have two sites, you need to tell Umbraco which site
is associated with each language. This is a simple point-n-click
operation.</p>

<p>Right-click the homepage for one of the sites and select the
'Manage hostnames' menu. In the window that appears, assign a
domain for this site and select the appropriate language.</p>

<p><a
href="http://blog.percipientstudios.com/media/5456/WindowsLiveWriter_e124bd42ab2d_C0D0_manage-hostnames_2.png">
<img
style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px"
 title="Manage hostnames to assign domain and language for a site"
border="0"
alt="Manage hostnames to assign domain and language for a site"
src="http://blog.percipientstudios.com/media/5461/WindowsLiveWriter_e124bd42ab2d_C0D0_manage-hostnames_thumb.png"
 width="435" height="234" /></a></p>

<p>Repeat for all sites.</p>

<p>You can find lots of forum posts about using separate domains or
a single domain and folders to distinguish one site from another
via the URL. Depending on your preferred URL you'll end up changing
either the&nbsp; umbracoHideTopLevelNodeFromPath (in web.config
file) or useDomainPrefixes (in /config/umbracoSettings.config). The
combination of these settings will effect the URL for the pages in
each site, but is beyond the scope of this article.</p>

<p>&nbsp;</p>

<h2>And now, back to XSLTsearch</h2>

<p><em>If using XSLTsearch 3.0, you should modify it as noted <a
href="http://blog.percipientstudios.com/2010/11/11/user-modification-to-xsltsearch-for-easier-multi-site-searching.aspx">
here</a>. This will be the default behavior for future versions of
XSLTsearch. This step is only necessary for v3.0.</em></p>

<h3>Create a search page for each site</h3>

<p>Now create a search page for each site. Right-click on the home
page of each site and select the Create menu. Name the page and
select the XSLTsearch document type.</p>

<p>Your content tree will now look similar to this, with a search
page in each site.</p>

<p><a
href="http://blog.percipientstudios.com/media/5466/WindowsLiveWriter_e124bd42ab2d_C0D0_xsltsearch-content-tree_2.png">
<img
style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px"
 title="XSLTsearch search pages in multiple Umbraco sites"
border="0" alt="XSLTsearch search pages in multiple Umbraco sites"
src="http://blog.percipientstudios.com/media/5471/WindowsLiveWriter_e124bd42ab2d_C0D0_xsltsearch-content-tree_thumb.png"
 width="211" height="345" /></a></p>

<h3>Translate the XSLTsearch dictionary keys for each language</h3>

<p>At this point, your search will work properly in all sites but
all the static text on the search page will be in English, which
isn't what we want.</p>

<p>The last step is to translate the XSLTsearch dictionary items
into the languages of your site.</p>

<p><em>You may notice that I don't speak German. I've used
Microsoft Translate and Warren Buckley's handy <a
href="http://our.umbraco.org/projects/backoffice-extensions/dictionary-translator-for-umbraco">
Dictionary Translator for Umbraco</a>. <strong></strong>I hope you
can excuse any mistakes :)</em></p>

<p>In the Settings section of Umbraco's back office, expand the
Dictionary area. You will see a folder of terms used by XSLTsearch.
Select each dictionary item in turn, entering the appropriate
translation for each language of your site. If you leave any blank
the default English term will be used in its place so at least your
site will have text for everything, albeit in English..</p>

<p><a
href="http://blog.percipientstudios.com/media/5476/WindowsLiveWriter_e124bd42ab2d_C0D0_xsltsearch-dictionary_2.png">
<img
style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px"
 title="XSLTsearch dictionary keys" border="0"
alt="XSLTsearch dictionary keys"
src="http://blog.percipientstudios.com/media/5481/WindowsLiveWriter_e124bd42ab2d_C0D0_xsltsearch-dictionary_thumb.png"
 width="435" height="242" /></a></p>

<p>&nbsp;</p>

<h2>Go forth and search!</h2>

<p>That's all there is to it. All the setup work is now complete
and you're ready to enjoy localized search pages across all the
languages of your site. If you later add another language site all
you'll need to do is create an XSLTsearch page in the new site and
translate the dictionary keys into the new site's language. It
couldn't be easier.</p>

<p>Here's what the finished result looks like, with example search
pages in both English and German:</p>

<h3>An English search page</h3>

<p><a
href="http://blog.percipientstudios.com/media/5486/WindowsLiveWriter_e124bd42ab2d_C0D0_xsltsearch-results-english_2.png">
<img
style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px"
 title="Search results in English" border="0"
alt="Search results in English"
src="http://blog.percipientstudios.com/media/5491/WindowsLiveWriter_e124bd42ab2d_C0D0_xsltsearch-results-english_thumb.png"
 width="350" height="418" /></a></p>

<h3>A German search page&nbsp;</h3>

<p><a
href="http://blog.percipientstudios.com/media/5496/WindowsLiveWriter_e124bd42ab2d_C0D0_xsltsearch-results-german_4.png">
<img
style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px"
 title="Search results in German" border="0"
alt="Search results in German"
src="http://blog.percipientstudios.com/media/5501/WindowsLiveWriter_e124bd42ab2d_C0D0_xsltsearch-results-german_thumb_1.png"
 width="356" height="435" /></a></p>
]]></content:encoded></item><item><title>Make an App_Code XSLT extension for Umbraco</title><link>http://blog.percipientstudios.com/2010/11/12/make-an-app_code-xslt-extension-for-umbraco.aspx</link><pubDate>Fri, 12 Nov 2010 10:02:37 GMT</pubDate><guid>http://blog.percipientstudios.com/2010/11/12/make-an-app_code-xslt-extension-for-umbraco.aspx</guid><description>
&lt;p&gt;New to Umbraco 4.5, XSLT extensions in the /App_Code folder
provides code that is right in front of you and easy to edit (even
for non-&quot;VisualStudio junkies&quot;). App_Code XSLT extensions are
strongly-defined (safer), cached-at-application-level (faster), and
medium-trust-capable (cheaper hosting). Wow!&lt;/p&gt;

&lt;p&gt;And they are so easy to make! Let me show you how.&lt;/p&gt;
</description><author>info@percipientstudios.com (Douglas Robar)</author><content:encoded><![CDATA[ <p>You may have noticed that XSLTsearch 3.0 moved all the C# helper
functions from in-line scripting within the XSLT file itself to
/app_code/xsltsearch.cs. The reasons for doing this and how to
create XSLT extensions without Visual Studio are the subject of
this article.</p>

<p>What is the App_Code folder you ask? As Microsoft puts it, "you
can store source code in the App_Code folder, and it will be
automatically compiled at run time. The resulting assembly is
accessible to any other code in the Web application. The App_Code
folder therefore works much like the Bin folder, except that you
can store source code in it instead of compiled code.</p>

<p>&nbsp;</p>

<h2>Extending XSLT's capabilities</h2>

<h3>Compiled XSLT extensions</h3>

<p>In the past, when you wanted to add a little extra oomph to your
XSLT macro you probably would have created an XSLT extension in
Visual Studio, compiled it to a dll, copied it to the /bin folder
of your site, and referenced it by updating the
/config/XSLTextensions.config file.</p>

<p>Simple, no?</p>

<p>Well, to be honest, sometimes it does seem a bit over the top
for just a few lines of .Net code. Especially if you aren't a .Net
Jedi™.</p>

<h3>What's wrong with &lt;msxml:script&gt; blocks?</h3>

<p>The other option in such a case is to place your .Net code in an
&lt;msxml:script&gt; block directly in your xslt file. I've found
this to be a powerful and easy-to-implement solution. Indeed, all
versions prior to XSLTsearch 3.0 used this technique as well.</p>

<p>There are down-sides to inline script blocks, though. For one
thing, the macro will compile itself every single time the macro is
run. That doesn't take long, but it adds up. Worse, you'll find a
lot of tiny files from those compilations cluttering your system
TEMP folder. This is especially evident if you haven't disabled
debugging in the web.config file. These are small files but on a
busy site they add up quickly and could potentially fill your
system drive. And because the system TEMP folder is outside your
website your macro won't run in medium trust.</p>

<p>Benjamin Howarth (<a
href="http://twitter.com/#!/benjaminhowarth/">@benjaminhowarth</a>)
discussed these and more in his illuminating presentation at the
Umbraco 5th Birthday party in London, <a
href="http://www.slideshare.net/warrenbuckley/umbraco-medium-trust">
Medium Trust for Umbraco 4.x</a>.</p>

<p>I still like the benefits of inline scripting:&nbsp; all code is
available for easy inspection, learning, and editing, and you never
have to fire up Visual Studio ("oh, that project was created with
VS 2005 and I only have VS 2099… hmmmm"). On the other hand, the
downsides of not creating a proper XSLT extension are fairly
significant.</p>

<h3>Welcome to App_Code XSLT extensions in Umbraco</h3>

<p>New to Umbraco 4.5, XSLT extensions in the /App_Code folder
provides the best of both worlds! Code that is right in front of
you and easy to edit, even for non-"VisualStudio junkies". And, you
get strongly-defined (safer), cached-at-application-level (faster),
and medium-trust-support (cheaper hosting). Wow!</p>

<p>And it is so easy to do! Let me show you how.</p>

<p>&nbsp;</p>

<h2>Reworking an old example</h2>

<p>I'm going to re-work an older post entitled, <a
href="http://blog.percipientstudios.com/2009/9/21/advanced-xslt-with-net-namespaces.aspx">Advanced
XSLT with .NET Namespaces</a>. You might want to read that article
if the following code doesn't make sense to you.</p>

<p>In that older article I used an inline script block to determine
the size of an uploaded file. This is something that can't be done
from XSLT alone so I added the following C# script block. Let's
remove the code from the script block and put it in an App_Code
extension.</p>

<div
style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px"
 id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:49eb05df-e1a6-4a72-9962-ddb57ea46541"
 class="wlWriterEditableSmartContent">
<pre class="brush: xml;">
&lt;msxml:script language="CSharp" implements-prefix="ps"&gt;
    &lt;msxml:using namespace="System.IO" /&gt;
    &lt;msxml:assembly name="System.Web" /&gt;
    &lt;msxml:using namespace="System.Web" /&gt;
 
    &lt;![CDATA[
    public String uploadFileSize(String filePath) {
 
        if ((filePath != null) &amp;&amp; (filePath.Length != 0)) {
            String localFile = HttpContext.Current.Server.MapPath(filePath);
            if (File.Exists(localFile)) {
                FileInfo fileinfo = new FileInfo(localFile);
                return String.Format("{0:#,###,###.##}", (fileinfo.Length / 1024));
            }
        }
        return null;
    }
    ]]&gt;
&lt;/msxml:script&gt;
</pre>
</div>

<h3>1. Create a file in the /app_code folder</h3>

<p>All we have to do to convert this script block to a proper XSLT
extension is create a file in the /app_code folder of my site. I'll
call it PShelpers.cs. You can create these App_Code XSLT extensions
with Notepad, Visual Studio (tip: create a 'Class Library'
project), or anything in between.</p>

<p>Your baseline, starting file should look like this:</p>

<div
style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px"
 id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:45012317-d38d-4e75-8821-2877a46cac94"
 class="wlWriterEditableSmartContent">
<pre class="brush: c#;">
using System;
using System.Collections;

namespace ClassLibrary
{
    public class Class1
    {
    }
}
</pre>
</div>

<h3>2. Name your class and namespace, add references</h3>

<p>Now, change the namespace and class names for your project, add
the umbraco api reference and any other namespaces you might
need:</p>

<div
style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px"
 id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:ff406990-91a9-4433-a0f0-d241dfc90a6d"
 class="wlWriterEditableSmartContent">
<pre class="brush: c#;">
using System;
using System.Collections;
using System.IO;
using System.Web;
using umbraco;

namespace PS
{
    public class Helpers
    {

    }
}
</pre>
</div>

<h3>3. Add [XsltExtension] and zero-parameter constructor</h3>

<p>Add the <strong>[XsltExtension]</strong> line to the namespace
and create a a <strong>zero-parameter constructor</strong> so that
Umbraco will automatically pick this up as an XSLT extension:</p>

<div
style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px"
 id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:7e53f709-3913-435e-a275-c822d46ad448"
 class="wlWriterEditableSmartContent">
<pre class="brush: c#;">
using System;
using System.Collections;
using System.IO;
using System.Web;
using umbraco;

namespace PS
{
    [XsltExtension]

    public class Helpers
    {
        public Helpers() { }
    }
}
</pre>
</div>

<h3>4. Paste the code from your script block</h3>

<p>Now all you do is copy-n-paste the code from your script
block.</p>

<p>Remember, all your <strong>functions must be public
static</strong>.</p>

<p>Here's the final version of our re-worked example, this time as
an App_Code XSLT extension:</p>

<div
style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px"
 id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:ab2b0ecd-d8d2-4062-8541-1e955605f478"
 class="wlWriterEditableSmartContent">
<pre class="brush: c#;">
using System;
using System.Collections;
using System.IO;
using System.Web;
using umbraco;

namespace ps
{
    [XsltExtension]

    public class Helpers
    {
        public Helpers() { }

        public static String uploadFileSize(String filePath)
        {

            if ((filePath != null) &amp;&amp; (filePath.Length != 0))
            {
                String localFile = HttpContext.Current.Server.MapPath(filePath);
                if (File.Exists(localFile))
                {
                    FileInfo fileinfo = new FileInfo(localFile);
                    return String.Format("{0:#,###,###.##}", (fileinfo.Length / 1024));
                }
            }
            return null;
        }

    }
}
</pre>
</div>

<p>&nbsp;</p>

<h2>Using your XSLT extension</h2>

<p>Now that you have a functioning XSLT extension you can remove
the msxml:script from your xslt file and update the references to
the new namespace and class. In our example, from 'ps' to
'PS.Helpers'. The macro will work as before, only in medium-trust
and with better performance.</p>

<p>Additionally, when you create a new macro in Umbraco your
App_Code XSLT extension will automatically be referenced. And when
you click the '<strong>Insert xsl:value-of</strong>' toolbar button
in Umbraco's XSLT editor you can select your App_Code XSLT
extension for point-n-click simplicity.</p>

<p><a
href="http://blog.percipientstudios.com/media/5377/WindowsLiveWriter_MakeanUmbracoXSLTextensioninApp_Code_D396_ps.helpers%20xslt%20extension%20get%20extension_2.png">
<img
style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px"
 title="Insert Value in XSLT dialog box" border="0"
alt="Insert Value in XSLT dialog box"
src="http://blog.percipientstudios.com/media/5382/WindowsLiveWriter_MakeanUmbracoXSLTextensioninApp_Code_D396_ps.helpers%20xslt%20extension%20get%20extension_thumb.png"
 width="435" height="149" /></a>&nbsp;</p>

<p><a
href="http://blog.percipientstudios.com/media/5387/WindowsLiveWriter_MakeanUmbracoXSLTextensioninApp_Code_D396_ps.helpers%20xslt%20extension%20insert%20value_2.png">
<img
style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px"
 title="Select your extension and functions" border="0"
alt="Select your extension and functions"
src="http://blog.percipientstudios.com/media/5392/WindowsLiveWriter_MakeanUmbracoXSLTextensioninApp_Code_D396_ps.helpers%20xslt%20extension%20insert%20value_thumb.png"
 width="435" height="149" /></a></p>

<p>&nbsp;</p>

<h2>"Gotcha" - only one language in App_Code</h2>

<p>An important point to mention is that all the files in App_Code
must use the same .Net language. You cannot mix C# for some files
and VB.net for others, for instance. However, there is a <a
href="http://msdn.microsoft.com/en-us/library/t990ks23.aspx">solution</a>
if you must mix languages in the /app_code folder.</p>

<h2>"Gotcha" again - App_Code bugs give YSOD</h2>

<p>Never edit anything in the App_Code folder on a live site. If
you make a mistake the site may display a Yellow Screen of Death
(YSOD). In some cases even the Umbraco back end won't respond
properly, or the site's application pool may shut down after
repeated errors. You've been warned and I take no responsibility.
Okay? Okay. But… if you are careful with your code (as of course
you will be) then app_code is no more dangerous than a dll.</p>
]]></content:encoded></item><item><title>User modification to XSLTsearch for easier multi-site searching</title><link>http://blog.percipientstudios.com/2010/11/11/user-modification-to-xsltsearch-for-easier-multi-site-searching.aspx</link><pubDate>Thu, 11 Nov 2010 10:59:33 GMT</pubDate><guid>http://blog.percipientstudios.com/2010/11/11/user-modification-to-xsltsearch-for-easier-multi-site-searching.aspx</guid><description>
&lt;p&gt;Sebastiaan Janssen (&lt;a
href=&quot;http://twitter.com/#%21/cultiv&quot;&gt;@cultiv&lt;/a&gt;) mentioned a nice
modification he makes to XSLTsearch on the &lt;a
href=&quot;http://our.umbraco.org/forum/core/general/14483-Multi-website-Single-Solution-Site-Specific-Search-without-visible-prefix&quot;&gt;
our.umbraco forum&lt;/a&gt; today, simplifying its use in multi-lingual
websites. It is so useful and simple I thought I would explain it
in detail.&lt;/p&gt;
</description><author>info@percipientstudios.com (Douglas Robar)</author><content:encoded><![CDATA[ <p>Sebastiaan Janssen (<a
href="http://twitter.com/#!/cultiv">@cultiv</a>) mentioned a nice
modification he makes to XSLTsearch on the <a
href="http://our.umbraco.org/forum/core/general/14483-Multi-website-Single-Solution-Site-Specific-Search-without-visible-prefix">
our.umbraco forum</a> today, simplifying its use in multi-lingual
websites. It is so useful and simple I thought I would explain it
in detail.</p>

<p>XSLTsearch 3.0 uses Umbraco dictionary keys to translate the
various bits of text that appear on the search page. The same
search macro can be used everywhere on your site and will display
in the site's language and culture.</p>

<p>You can either search all pages or specify the page to begin
searching beneath (the 'source' parameter in the XSLTsearch macro).
If you have multiple websites within one Umbraco installation you
can make a small change to XSLTsearch and each site will instantly
<strong>search only within its own pages</strong>.</p>

<p>Here's what a typical multi-site installation would look
like:</p>

<p><a
href="http://blog.percipientstudios.com/media/5352/WindowsLiveWriter_UsermodificationtoXSLTsearchforeasiermul_E0EC_XSLTsearch%20in%20multiple%20umbraco%20sites_2.png">
<img
 title="XSLTsearch in multiple umbraco sites" border="0"
alt="XSLTsearch in multiple umbraco sites"
src="http://blog.percipientstudios.com/media/5357/WindowsLiveWriter_UsermodificationtoXSLTsearchforeasiermul_E0EC_XSLTsearch%20in%20multiple%20umbraco%20sites_thumb.png"
 width="435" height="300" /></a></p>

<p>We'd rather not create multiple templates for XSLTsearch for
each site, nor insert the XSLTsearch macro in a richtext editor
page on each site, forcing editors to decide what to enter in each
of the macro properties.</p>

<p>Thankfully XSLTsearch is easy to modify to meet your needs. The
key, as Sebastiaan says, is to use the ancestor-or-self XPATH axis
to set the source used when searching. We want to use the top-most
page in whatever site is currently being viewed. That is, to the
page that is at the first level in the content tree.</p>

<p>By default, XSLTsearch will search all pages if you don't tell
it otherwise.</p>

<div
style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px"
 id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:7cf33a38-d89c-44d1-a90e-c5c70766b253"
 class="wlWriterEditableSmartContent">
<pre class="brush: xml;">
&lt;xsl:call-template name="search"&gt;
  &lt;xsl:with-param name="items" select="umbraco.library:GetXmlAll()/*"/&gt;
&lt;/xsl:call-template&gt;
</pre>
</div>

<p>&nbsp;</p>

<p>What we want to do is change the default behavior to this:</p>

<div
style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px"
 id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:d1d22a54-2cc7-4596-879b-39941a6d3dd2"
 class="wlWriterEditableSmartContent">
<pre class="brush: xml;">

&lt;xsl:call-template name="search"&gt;
  &lt;xsl:with-param name="items" select="$currentPage/ancestor-or-self::*[@level = '1']"/&gt;
&lt;/xsl:call-template&gt;
</pre>
</div>

<p>&nbsp;</p>

<p>That's all there is to it! Thanks for the tip, Sebastiaan!</p>
]]></content:encoded></item></channel></rss>
