<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Owain Williams</title>
    <description>The latest articles on DEV Community by Owain Williams (@owainwilliams).</description>
    <link>https://dev.to/owainwilliams</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F65179%2F6d4edfad-60c3-431a-a35f-885393a83259.jpg</url>
      <title>DEV Community: Owain Williams</title>
      <link>https://dev.to/owainwilliams</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/owainwilliams"/>
    <language>en</language>
    <item>
      <title>Umbraco "hidden" properties - umbracoUrlName and umbracoUrlAlias</title>
      <dc:creator>Owain Williams</dc:creator>
      <pubDate>Wed, 06 Jan 2021 00:00:00 +0000</pubDate>
      <link>https://dev.to/owainwilliams/umbraco-hidden-properties-umbracourlname-and-umbracourlalias-4mjl</link>
      <guid>https://dev.to/owainwilliams/umbraco-hidden-properties-umbracourlname-and-umbracourlalias-4mjl</guid>
      <description>&lt;p&gt;While working on a project I came across an issue where having the ability to give a different url for a page within the CMS would be beneficial. &lt;/p&gt;

&lt;p&gt;In the past, I've always just used &lt;code&gt;umbracoUrlAlias&lt;/code&gt; but it was suggested that &lt;code&gt;umbracoUrlName&lt;/code&gt; might be a better option. This short blog will hopefully bring these properties to light for some of you. &lt;/p&gt;

&lt;h2&gt;
  
  
  How do you use them?
&lt;/h2&gt;

&lt;p&gt;Both properties can be use on any document type that is accessible via the front end of your site e.g. &lt;a href="http://www.owain.codes/about"&gt;http://www.owain.codes/about&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Add a text string to your document type and make sure that the alias is &lt;code&gt;umbracoUrlAlias&lt;/code&gt; or &lt;code&gt;umbracoUrlName&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;An example is below for &lt;code&gt;umbracoUrlName&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Sk4UbT2H--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://owain.codes/media/8d8b27e1a7c69f0/propertyeditor.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Sk4UbT2H--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://owain.codes/media/8d8b27e1a7c69f0/propertyeditor.jpg" alt="enter image description here" width="478" height="518"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Of course, you can change the Name from &lt;code&gt;umbracoUrlName&lt;/code&gt; but make sure the alias, the bit  next to the padlock, remains &lt;code&gt;umbracoUrlName&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's the difference between the two?
&lt;/h2&gt;

&lt;p&gt;I'll use the description that is used within the &lt;a href="https://our.umbraco.com/Documentation/Reference/Routing/routing-properties"&gt;Umbraco Documentation&lt;/a&gt;, &lt;/p&gt;

&lt;h3&gt;
  
  
  umbracoUrlAlias
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;This property when created as a text string lets you provide a comma separated list of alternate full URL paths for the node. For example, if your URL was /some-category/some-page/content-node, by adding an umbracoUrlAlias of "flowers", a user can navigate to the node by going to /flowers. The URL alias remains in the browser address bar as a 'mask' over the real URL. You can also specify paths like "flowers/roses/red".&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;One thing to note is that the original URL is also still accessible. To help understand this, if you think about this property as a url shorterner then it will hopefully make it a bit clearer. &lt;/p&gt;

&lt;h3&gt;
  
  
  umbracoUrlName
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;This property when created as a text string lets you provide a different URL name to what is created by default by the name of the node. If you enter a value for this property and save/publish the content node, you will see that its main URL is updated with a new path suffix.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If we use the example that was used above and use the path &lt;code&gt;/some-category/some-page/content-node&lt;/code&gt;, if we use &lt;code&gt;umbracoUrlName&lt;/code&gt; property and use the word &lt;code&gt;flowers&lt;/code&gt;as the value, the url for this page / node is now &lt;code&gt;/flowers&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;The longer path name now doesn't exist and the only way to access this node is via &lt;code&gt;/flowers&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Other routing options
&lt;/h3&gt;

&lt;p&gt;There are two other options built in to Umbraco that you can use when handling routing. &lt;br&gt;
&lt;code&gt;umbracoRedirect&lt;/code&gt; and &lt;code&gt;umbracoRedirectId&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;In short, &lt;code&gt;umbracoRedirect&lt;/code&gt; performs a 302 redirect by using a Content Picker and &lt;code&gt;umbracoRedirectId&lt;/code&gt; does a url rewrite. &lt;/p&gt;

&lt;p&gt;For more info, check out the &lt;a href="https://our.umbraco.com/Documentation/Reference/Routing/routing-properties"&gt;Umbraco Documentation&lt;/a&gt;&lt;/p&gt;

</description>
      <category>umbraco</category>
    </item>
    <item>
      <title>Null Conditional Operator for fallback images</title>
      <dc:creator>Owain Williams</dc:creator>
      <pubDate>Thu, 10 Dec 2020 00:00:00 +0000</pubDate>
      <link>https://dev.to/owainwilliams/null-conditional-operator-for-fallback-images-4akg</link>
      <guid>https://dev.to/owainwilliams/null-conditional-operator-for-fallback-images-4akg</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F4t1vobhcjaccdaulmf89.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F4t1vobhcjaccdaulmf89.jpg" alt="Generic Header image" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Last night when working on my new version of &lt;a href="https://www.owain.codes"&gt;Owain.Codes&lt;/a&gt; I managed to blow up the site. &lt;/p&gt;

&lt;p&gt;The reason? &lt;/p&gt;

&lt;p&gt;I hadn't put an image in to the CMS and when I rendered out the image or the lack of an image on the front end, I got a null exception error.&lt;/p&gt;

&lt;p&gt;I started to write a bit of code to handle this which looked a bit like&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@if(Model.Image.Url() == null)
{
  set default image as fallback.jpg
}
else{
  use the image from the CMS
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But then I thought, there must be a nicer way to handle fallbacks, and I believe I have found that nicer option and its by using the &lt;a href="https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/operators/member-access-operators#null-conditional-operators--and-"&gt;Null Conditional Operator&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So I am now using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; var blogImage = Model.PageBanner?.Url() ?? "assets/images/noImage.jpg";
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So if the &lt;code&gt;Model.PageBanner&lt;/code&gt; is null, give me the noImage.jpg fall back string, else give me the &lt;code&gt;Model.PageBanner.Url()&lt;/code&gt;. I then use the variable blogImage on my page.&lt;/p&gt;

&lt;p&gt;I now don't need to worry about whether I set an image for a blog or not. Either way I will have an image on my page.&lt;/p&gt;

</description>
      <category>csharp</category>
    </item>
    <item>
      <title>Restart Visual Studio as Admin in seconds</title>
      <dc:creator>Owain Williams</dc:creator>
      <pubDate>Fri, 04 Dec 2020 00:00:00 +0000</pubDate>
      <link>https://dev.to/owainwilliams/restart-visual-studio-as-admin-in-seconds-2jj9</link>
      <guid>https://dev.to/owainwilliams/restart-visual-studio-as-admin-in-seconds-2jj9</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fblpq5opj2d49443oovdq.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fblpq5opj2d49443oovdq.jpg" alt="blogcomputerimagelrg" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Last week &lt;a href="https://twitter.com/HotChilliCode"&gt;@HotChilliCode&lt;/a&gt; aka Nik shared this &lt;a href="https://twitter.com/shanselman/"&gt;Scott Hanselman&lt;/a&gt; video with me : "Overwhelmed with Programming? Here's small things to help - Computer Stuff They Didn't Teach You #14"&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/5CmjW_8ief4"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;During the video Scott talks about finding ways to reduce repetition. If you find yourself doing something over and over again, is there a way to speed it up? Can you automate it in some way.&lt;/p&gt;

&lt;p&gt;Well today I found myself, for probably the 100th day in a row, needing to attach my debugger in Visual Studio to my local IIS instance. The only issue was, I wasn't running in Admin mode.&lt;/p&gt;

&lt;p&gt;I needed to close visual studio, right click the icon, open as Admin then reload my solution. Not a massive issue but I had noticed I've been doing this a lot recently as Visual Studio for me doesn't automatically run in Admin mode. I know, I could set it up to run in Admin mode straight away but then if I am doing screen shares, the person I'm sharing with can't interact with my VS screen so then I need to shutdown VS, remove the setting to start as Admin. It's just a pain.&lt;/p&gt;

&lt;p&gt;Anyway, I found an Visual Studio Extension called &lt;a href="https://github.com/ilmax/vs-restart"&gt;Visual Studio Restart&lt;/a&gt; and all it does is, it adds a Link in your File menu that will shutdown VS, restart it in Admin mode and also reload the solution you are working on. Brilliant! &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note: I am using VS2019 Community Edition, I've not tested this in any other versions.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The next thing I did was I &lt;a href="https://docs.microsoft.com/en-us/visualstudio/ide/identifying-and-customizing-keyboard-shortcuts-in-visual-studio?view=vs-2019"&gt;assigned a shortcut key&lt;/a&gt; to the restart command. The key combo I used is &lt;code&gt;Ctrl+ '&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;So now, if I am working on a project that I haven't loaded as Admin, I tap &lt;code&gt;Ctrl + '&lt;/code&gt; and boom, I'm up and running in Admin mode in seconds.&lt;/p&gt;

</description>
      <category>visualstudio</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Load Windows Terminal from Explorer Window</title>
      <dc:creator>Owain Williams</dc:creator>
      <pubDate>Wed, 02 Dec 2020 00:00:00 +0000</pubDate>
      <link>https://dev.to/owainwilliams/load-windows-terminal-from-explorer-window-30f4</link>
      <guid>https://dev.to/owainwilliams/load-windows-terminal-from-explorer-window-30f4</guid>
      <description>&lt;p&gt;Today I found myself once again trying to be more efficient with my keystrokes and mouse movements and it got me wondering. If I am in a folder, can I open up a Windows Terminal from that folder?&lt;/p&gt;

&lt;p&gt;First of all, let me tell you what Windows Terminal is - basically, its Windows Command Prompt on steroids.&lt;/p&gt;

&lt;p&gt;Official description is: &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The Windows Terminal is a modern, fast, efficient, powerful, and productive terminal application for users of command-line tools and shells like Command Prompt, PowerShell, and WSL. Its main features include multiple tabs, panes, Unicode and UTF-8 character support, a GPU accelerated text rendering engine, and custom themes, styles, and configurations."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It's also open source so you can play around with it and really customise things if you wants.&lt;/p&gt;

&lt;p&gt;You can download Windows Terminal from &lt;a href="https://www.microsoft.com/en-gb/p/windows-terminal/9n0dx20hk701?activetab=pivot:overviewtab"&gt;Microsoft.com&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Solve the problem
&lt;/h2&gt;

&lt;p&gt;I know that if I type &lt;code&gt;cmd&lt;/code&gt; in to the explorer path area it will load up the command prompt.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fe0o61i02khirxlpeehpg.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fe0o61i02khirxlpeehpg.gif" alt="cmdprompt" width="800" height="184"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What I didn't realise was if I type in 'wt' it will load up a new instance of Windows Terminal. However, this just opens up a new Terminal but you still need to navigate to the folder you were in via the command line. That's not really any saving in time.&lt;/p&gt;

&lt;p&gt;After a bit of googling, what I found was, you can edit the settings for Windows Terminal.&lt;/p&gt;

&lt;p&gt;If you open up Setting via the dropdown menu in your Windows Terminal....&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fm7a3wdsnwl03op5w7c9m.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fm7a3wdsnwl03op5w7c9m.gif" alt="wtsetup" width="800" height="300"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then you need to add the &lt;code&gt;"startingDirectory": "."&lt;/code&gt; to each of the profiles within the settings.json file.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fwsljmkw6a925iet3z8tk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fwsljmkw6a925iet3z8tk.png" alt="settingswt" width="800" height="1064"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now when you save this file, and go back to Explorer and type in wt, your terminal window will load and direct you to the folder path that you were originally in.&lt;/p&gt;

&lt;h3&gt;
  
  
  Bonus content
&lt;/h3&gt;

&lt;p&gt;I also decided to add a bit of transparency to the Windows Terminal by adding the two additional values - &lt;code&gt;"useAcrylic": true&lt;/code&gt; and &lt;code&gt;"acrylicOpacity": 0.5&lt;/code&gt;you can obviously change the 0.5 to any value you like to make the transparency work better for you. One thing to look out for though, if you don't have transparceny effect turned on in your Windows settings, it doesn't matter what you do in the settings.json file, your terminal won't show any difference.&lt;/p&gt;

&lt;p&gt;To turn transparency on, go to Start Menu -&amp;gt; Settings -&amp;gt; Personalisation -&amp;gt; Colours and then toggle the Transparency Effects to On.&lt;/p&gt;

&lt;p&gt;Now load up a terminal and it should have a transparent background, you can even put an image there instead and have a different image for different terminal windows. Check out the &lt;a href="https://docs.microsoft.com/en-us/windows/terminal/customize-settings/profile-settings"&gt;official documentation&lt;/a&gt; for all your options - go wild!&lt;/p&gt;

</description>
      <category>terminal</category>
      <category>howto</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Obsolete Umbraco Property Types.</title>
      <dc:creator>Owain Williams</dc:creator>
      <pubDate>Thu, 09 Jul 2020 00:00:00 +0000</pubDate>
      <link>https://dev.to/owainwilliams/obsolete-umbraco-property-types-2bh9</link>
      <guid>https://dev.to/owainwilliams/obsolete-umbraco-property-types-2bh9</guid>
      <description>&lt;p&gt;Yesterday I had a bit of a panic. I was bug fixing something for a client and I changed the property editor from (Obsolete) Media Picker to Media Pick... &lt;a href="https://www.owain.codes/blog/posts/2020/july/obsolete-umbraco-property-types/"&gt;Continue reading&lt;/a&gt;&lt;/p&gt;

</description>
      <category>umbraco</category>
      <category>configuration</category>
    </item>
    <item>
      <title>Umbraco Uno - A first glance</title>
      <dc:creator>Owain Williams</dc:creator>
      <pubDate>Thu, 18 Jun 2020 00:00:00 +0000</pubDate>
      <link>https://dev.to/owainwilliams/umbraco-uno-a-first-glance-3f6b</link>
      <guid>https://dev.to/owainwilliams/umbraco-uno-a-first-glance-3f6b</guid>
      <description>&lt;p&gt;Umbraco Uno - A first glance Umbraco Uno - The one-stop website platform for creative agencies. That's the tag line Umbraco have given their latest... &lt;a href="https://www.owain.codes/blog/posts/2020/june/umbraco-uno/"&gt;Continue reading&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Convert HTML to Markdown</title>
      <dc:creator>Owain Williams</dc:creator>
      <pubDate>Thu, 04 Jun 2020 00:00:00 +0000</pubDate>
      <link>https://dev.to/owainwilliams/convert-html-to-markdown-3l77</link>
      <guid>https://dev.to/owainwilliams/convert-html-to-markdown-3l77</guid>
      <description>&lt;p&gt;After a discussion with a fellow developer on Slack one evening (Cheers Nik!), I found I had a side project to play with. I have been trying to do som... &lt;a href="https://www.owain.codes/blog/posts/2020/june/convert-a-html-blog-in-to-markdown/"&gt;Continue reading&lt;/a&gt;&lt;/p&gt;

</description>
      <category>csharp</category>
      <category>markdown</category>
      <category>dotnet</category>
    </item>
    <item>
      <title>Umbraco MVPs of 2019</title>
      <dc:creator>Owain Williams</dc:creator>
      <pubDate>Tue, 08 Oct 2019 00:00:00 +0000</pubDate>
      <link>https://dev.to/owainwilliams/umbraco-mvps-of-2019-58mn</link>
      <guid>https://dev.to/owainwilliams/umbraco-mvps-of-2019-58mn</guid>
      <description>&lt;p&gt;&lt;a href="https://www.owain.codes/blog/posts/2019/october/umbraco-mvps-of-2019/"&gt;Continue reading&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>White screen on umbraco backoffice after an upgrade</title>
      <dc:creator>Owain Williams</dc:creator>
      <pubDate>Mon, 08 Jul 2019 00:00:00 +0000</pubDate>
      <link>https://dev.to/owainwilliams/white-screen-on-umbraco-backoffice-after-an-upgrade-f9b</link>
      <guid>https://dev.to/owainwilliams/white-screen-on-umbraco-backoffice-after-an-upgrade-f9b</guid>
      <description>&lt;p&gt;This week I had an issue where I had upgraded a website from Umbraco 7.7 to 7.14. The bit that really confused me was the site worked prefectly on my ... &lt;a href="https://www.owain.codes/blog/posts/2019/july/white-screen-on-umbraco-backoffice-after-an-upgrade/"&gt;Continue reading&lt;/a&gt;&lt;/p&gt;

</description>
      <category>umbraco</category>
    </item>
    <item>
      <title>Really? Is that your job title??</title>
      <dc:creator>Owain Williams</dc:creator>
      <pubDate>Thu, 15 Jun 2017 00:00:00 +0000</pubDate>
      <link>https://dev.to/owainwilliams/really-is-that-your-job-title-1kcg</link>
      <guid>https://dev.to/owainwilliams/really-is-that-your-job-title-1kcg</guid>
      <description>&lt;p&gt;Why do I say that? When it comes to getting jobs, it's not easy for me, I go to the interview, answer all their questions with confidence and ease unt... &lt;a href="https://www.owain.codes/blog/posts/2017/june/senior-developer-really-is-that-your-job-title/"&gt;Continue reading&lt;/a&gt;&lt;/p&gt;

</description>
      <category>impostersyndrome</category>
      <category>thoughts</category>
    </item>
  </channel>
</rss>
