<?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>Umbraco Archives - Blog IT</title>
	<atom:link href="https://blogit.create.pt/tag/umbraco/feed/" rel="self" type="application/rss+xml" />
	<link>https://blogit.create.pt/tag/umbraco/</link>
	<description>Create IT blogger community</description>
	<lastBuildDate>Thu, 10 Jan 2019 12:46:13 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.1</generator>
	<item>
		<title>Adding an Angular app to your Umbraco Website</title>
		<link>https://blogit.create.pt/marionunes/2018/03/10/adding-an-angular-app-to-your-umbraco-website/</link>
					<comments>https://blogit.create.pt/marionunes/2018/03/10/adding-an-angular-app-to-your-umbraco-website/#comments</comments>
		
		<dc:creator><![CDATA[Mário Nunes]]></dc:creator>
		<pubDate>Sat, 10 Mar 2018 22:11:23 +0000</pubDate>
				<category><![CDATA[Angular]]></category>
		<category><![CDATA[Umbraco]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[.NET]]></category>
		<guid isPermaLink="false">http://blogit.create.pt/marionunes/?p=334</guid>

					<description><![CDATA[<p>What problems does this solve? This enables you to have an Angular application alongside your Umbraco website, on a specified route. The Angular App can be protected by the Authentication of your website, if you have it. And you can make use of surface controllers for authenticated requests. The routing of your app will work [&#8230;]</p>
<p>The post <a href="https://blogit.create.pt/marionunes/2018/03/10/adding-an-angular-app-to-your-umbraco-website/">Adding an Angular app to your Umbraco Website</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><strong>What problems does this solve?</strong></p>
<ul>
<li>This enables you to have an Angular application alongside your Umbraco website, on a specified route.</li>
<li>The Angular App can be protected by the Authentication of your website, if you have it. And you can make use of surface controllers for authenticated requests.</li>
<li>The routing of your app will work as intended, for example, if your Angular app is at <strong>/app</strong> and you make a request to <strong>/app/products</strong>, the request will be routed to the angular app products&#8217; page.</li>
</ul>
<p><strong>What this is not</strong></p>
<ul>
<li>A complete front end for a Umbraco website with dynamic routes.</li>
<li>This doesn&#8217;t have dynamic routes, you have to specify them on your code.</li>
</ul>
<p><strong>Let&#8217;s get started!</strong></p>
<p>First, start by creating a controller to handle the Angular App request.</p>
<pre class="brush: csharp; title: ; notranslate">
using System.Web.Mvc;

public class AngularAppController : BaseController
{
    public ActionResult AngularAppView()
    {
        return View();
    }
}
</pre>
<p>Then, you have to decide the route where your Angular app will render. On this example it will be <strong>/angularapp</strong>.</p>
<p>On your ApplicationStarted method, put this code:</p>
<pre class="brush: csharp; title: ; notranslate">
RouteTable.Routes.MapRoute(
  &quot;AngularApp&quot;,
  &quot;angularapp/{*.}&quot;,
  new { controller = &quot;AngularApp&quot;, action = &quot;AngularAppView&quot; });
</pre>
<p>The <strong>{*.}</strong> syntax is what makes your angular app routes load and not return the 404 page.</p>
<p>If you don&#8217;t have an ApplicationStarted method, find out how you to create it here: <a href="https://our.umbraco.org/documentation/reference/events/application-startup">https://our.umbraco.org/documentation/reference/events/application-startup</a></p>
<p>Under your Views folder, create a folder with the same name as the <strong>controller</strong> you set in MapRoute. In this case it will be &#8220;AngularApp&#8221;.<br />
Inside it, create a view with the same name as the <strong>action</strong> set you set in MapRoute.<br />
<img decoding="async" src="http://blogit-create.com/wp-content/uploads/2018/03/appview.png" alt="" width="268" height="71" class="alignnone size-full wp-image-414" srcset="https://blogit.create.pt/wp-content/uploads/2018/03/appview.png 268w, https://blogit.create.pt/wp-content/uploads/2018/03/appview-265x71.png 265w" sizes="(max-width: 268px) 100vw, 268px" /></p>
<p>Inside the view put the contents of the index.html of your angular app.<br />
Then you will need to move your angular app files somewhere like you /Assets folder, and edit their paths on the view.</p>
<p>Almost done!</p>
<p>Now you need to edit the routes of your Angular app.<br />
Simply add the route you chose as a prefix to the routes.</p>
<p>From something like this:</p>
<pre class="brush: csharp; title: ; notranslate">
const routes: Routes = &#x5B;
  { path: '', redirectTo: '/dashboard', pathMatch: 'full' },
  { path: '/dashboard', component: DashboardComponent },
  { path: '/detail/:id', component: HeroDetailComponent },
  { path: '/heroes', component: HeroesComponent }
];
</pre>
<p>To this:</p>
<pre class="brush: csharp; title: ; notranslate">
const routes: Routes = &#x5B;
  { path: 'angularapp', redirectTo: 'angularapp/dashboard', pathMatch: 'full' },
  { path: 'angularapp/dashboard', component: DashboardComponent },
  { path: 'angularapp/detail/:id', component: HeroDetailComponent },
  { path: 'angularapp/heroes', component: HeroesComponent }
];
</pre>
<p>Thanks for reading!<br />
Mário</p>
<p>The post <a href="https://blogit.create.pt/marionunes/2018/03/10/adding-an-angular-app-to-your-umbraco-website/">Adding an Angular app to your Umbraco Website</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blogit.create.pt/marionunes/2018/03/10/adding-an-angular-app-to-your-umbraco-website/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Syncing Member Types with uSync</title>
		<link>https://blogit.create.pt/marionunes/2017/11/06/syncing-member-types-with-usync/</link>
					<comments>https://blogit.create.pt/marionunes/2017/11/06/syncing-member-types-with-usync/#respond</comments>
		
		<dc:creator><![CDATA[Mário Nunes]]></dc:creator>
		<pubDate>Mon, 06 Nov 2017 11:22:24 +0000</pubDate>
				<category><![CDATA[Umbraco]]></category>
		<category><![CDATA[uSync]]></category>
		<guid isPermaLink="false">http://blogit.create.pt/marionunes/?p=204</guid>

					<description><![CDATA[<p>This took me longer to figure out than it should have. uSync has MemberType synchronization disabled by default. To enable it simply go to Config\uSyncBackOffice.Config and set MemberTypeHandler to true. &#60;Handlers Group=&#34;default&#34; EnableMissing=&#34;true&#34;&#62; &#60;HandlerConfig Name=&#34;uSync: DataTypeHandler&#34; Enabled=&#34;true&#34; /&#62; &#60;HandlerConfig Name=&#34;uSync: TemplateHandler&#34; Enabled=&#34;true&#34; /&#62; &#60;HandlerConfig Name=&#34;uSync: ContentTypeHandler&#34; Enabled=&#34;true&#34; /&#62; &#60;HandlerConfig Name=&#34;uSync: MediaTypeHandler&#34; Enabled=&#34;true&#34; /&#62; &#60;HandlerConfig Name=&#34;uSync: [&#8230;]</p>
<p>The post <a href="https://blogit.create.pt/marionunes/2017/11/06/syncing-member-types-with-usync/">Syncing Member Types with uSync</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>This took me longer to figure out than it should have.</p>
<p>uSync has MemberType synchronization disabled by default.</p>
<p>To enable it simply go to Config\uSyncBackOffice.Config and set MemberTypeHandler to true.</p>
<pre class="brush: xml; highlight: [11]; title: ; notranslate">
&lt;Handlers Group=&quot;default&quot; EnableMissing=&quot;true&quot;&gt;
    &lt;HandlerConfig Name=&quot;uSync: DataTypeHandler&quot; Enabled=&quot;true&quot; /&gt;
    &lt;HandlerConfig Name=&quot;uSync: TemplateHandler&quot; Enabled=&quot;true&quot; /&gt;

    &lt;HandlerConfig Name=&quot;uSync: ContentTypeHandler&quot; Enabled=&quot;true&quot; /&gt;
    &lt;HandlerConfig Name=&quot;uSync: MediaTypeHandler&quot; Enabled=&quot;true&quot; /&gt;
    &lt;HandlerConfig Name=&quot;uSync: LanguageHandler&quot; Enabled=&quot;true&quot; /&gt;
    &lt;HandlerConfig Name=&quot;uSync: DictionaryHandler&quot; Enabled=&quot;true&quot; /&gt;
    &lt;HandlerConfig Name=&quot;uSync: MacroHandler&quot; Enabled=&quot;true&quot; /&gt;
    &lt;HandlerConfig Name=&quot;uSync: DataTypeMappingHandler&quot; Enabled=&quot;true&quot; /&gt;
    &lt;HandlerConfig Name=&quot;uSync: MemberTypeHandler&quot; Enabled=&quot;true&quot; /&gt;
    
    &lt;!-- content edition - if installed --&gt;
    &lt;HandlerConfig Name=&quot;uSync: ContentHandler&quot; Enabled=&quot;true&quot; /&gt;
    &lt;HandlerConfig Name=&quot;uSync: MediaHandler&quot; Enabled=&quot;true&quot; /&gt;
&lt;/Handlers&gt;
</pre>
<p>
Thanks for reading!</p>
<p>Mário Nunes</p>
<p>The post <a href="https://blogit.create.pt/marionunes/2017/11/06/syncing-member-types-with-usync/">Syncing Member Types with uSync</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blogit.create.pt/marionunes/2017/11/06/syncing-member-types-with-usync/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Working with Umbraco 7.6 New Pickers</title>
		<link>https://blogit.create.pt/marionunes/2017/11/05/working-with-umbraco-7-6-new-pickers/</link>
					<comments>https://blogit.create.pt/marionunes/2017/11/05/working-with-umbraco-7-6-new-pickers/#respond</comments>
		
		<dc:creator><![CDATA[Mário Nunes]]></dc:creator>
		<pubDate>Sun, 05 Nov 2017 14:01:26 +0000</pubDate>
				<category><![CDATA[Umbraco]]></category>
		<guid isPermaLink="false">http://blogit.create.pt/marionunes/?p=104</guid>

					<description><![CDATA[<p>With the old pickers, we could do something like this: page.SetValue(&#34;myPicker&#34;, content.Id); With the new pickers, we can&#8217;t use IDs anymore, we have to use UDIs instead. They look like this: "umb://document/28b551d1e9e74c758686604c9168b910" So how can we get the content UDI? If we have an IContent, we can simply use the extension string udi = content.GetUdi().ToString(); [&#8230;]</p>
<p>The post <a href="https://blogit.create.pt/marionunes/2017/11/05/working-with-umbraco-7-6-new-pickers/">Working with Umbraco 7.6 New Pickers</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>With the old pickers, we could do something like this:</p>
<pre class="brush: csharp; title: ; notranslate">
page.SetValue(&quot;myPicker&quot;, content.Id);
</pre>
<p>With the new pickers, we can&#8217;t use IDs anymore, we have to use UDIs instead. They look like this:</p>
<p><code>"umb://document/28b551d1e9e74c758686604c9168b910"</code></p>
<p>So how can we get the content UDI?<br />
If we have an <strong>IContent</strong>, we can simply use the extension</p>
<pre class="brush: csharp; title: ; notranslate">
string udi = content.GetUdi().ToString();
</pre>
<p>If we have an <strong>IPublishedContent</strong>, we need to do a little bit more work.<br />
Umbraco provides a built in function to create UDIs. To use it, we need these:</p>
<pre class="brush: csharp; title: ; notranslate">
using Umbraco.Core;
using static Umbraco.Core.Constants;
</pre>
<p>Get the UDI like this:</p>
<pre class="brush: csharp; title: ; notranslate">
string udi = Udi.Create(UdiEntityType.Document, content.GetKey()).ToString();
</pre>
<blockquote><p>If you want to set <strong>multiple items</strong>, separate the udis with a comma. The resulting string should be like this:<br />
<code>"umb://document/28b551d1e9e74c758686604c9168b910,umb://document/28b551d1e9e74c758686604c9168b912,..."</code></p></blockquote>
<p></p>
<hr>
<p>To clean up the code, I created an extension class.</p>
<pre class="brush: csharp; title: ; notranslate">
    using Umbraco.Core;
    using Umbraco.Core.Models;
    using Umbraco.Web;
    using static Umbraco.Core.Constants;

    public static class UmbracoExtensions
    {
        /// &lt;summary&gt;
        /// Gets the specified content udi.
        /// &lt;/summary&gt;
        /// &lt;param name=&quot;content&quot;&gt;The content.&lt;/param&gt;
        /// &lt;returns&gt;The content udi.&lt;/returns&gt;
        public static string GetUdi(this IPublishedContent content)
        {
            return Udi.Create(UdiEntityType.Document, content.GetKey()).ToString();
        }
    }
</pre>
<p>With this extension, you can set the pickers with IPublishedContent with just one line of code!</p>
<pre class="brush: csharp; title: ; notranslate">
page.SetValue(&quot;myPicker&quot;, content.GetUdi());
</pre>
<p></p>
<hr>
<p><strong>So why not use IContent all the time?</strong><br />
To get an IContent, we need to use a service like MediaService or ContentService, they are much slower that getting and IPublishedContent through Umbraco.TypedContent(), which gets it from cache.</p>
<p><strong>UPDATE:</strong> Support for member pickers. Other pickers might need additional code too.</p>
<pre class="brush: csharp; title: ; notranslate">
public static string GetUdi(this IPublishedContent content)
{
    string entityType = UdiEntityType.Document;

    if (string.Equals(Models.Member.ModelTypeAlias, content.ContentType.Alias))
    {
        entityType = UdiEntityType.Member;
    }

    return Udi.Create(entityType, content.GetKey()).ToString();
}
</pre>
<p>Thanks for reading,<br />
Mário Nunes</p>
<p>The post <a href="https://blogit.create.pt/marionunes/2017/11/05/working-with-umbraco-7-6-new-pickers/">Working with Umbraco 7.6 New Pickers</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blogit.create.pt/marionunes/2017/11/05/working-with-umbraco-7-6-new-pickers/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
