<?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>Sitecore Xperiences &#187; Architecture</title>
	<atom:link href="http://blog.peplau.com.br/category/architecture/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.peplau.com.br</link>
	<description>The things I&#039;ve seen as a Sitecore Professional</description>
	<lastBuildDate>Sun, 13 Feb 2022 16:58:23 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.34</generator>
	<item>
		<title>Developers working in parallel with Continuous Integration builds for Dev and QA</title>
		<link>http://blog.peplau.com.br/developers-working-in-parallel-with-continuous-integration-builds-for-dev-and-qa/</link>
		<comments>http://blog.peplau.com.br/developers-working-in-parallel-with-continuous-integration-builds-for-dev-and-qa/#comments</comments>
		<pubDate>Sun, 20 Nov 2016 20:14:53 +0000</pubDate>
		<dc:creator><![CDATA[Rodrigo Peplau]]></dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Continuous Integration]]></category>
		<category><![CDATA[Dev]]></category>
		<category><![CDATA[Environments]]></category>
		<category><![CDATA[QA]]></category>

		<guid isPermaLink="false">http://blog.peplau.com.br/?p=490</guid>
		<description><![CDATA[<div class="lr_horizontal_share" data-share-url="http://blog.peplau.com.br/developers-working-in-parallel-with-continuous-integration-builds-for-dev-and-qa/"></div>When multiple developers are working in parallel (at the same build, but working in different parts) it is very common to use branches at source control, to keep each developer working in isolation and eliminating any chance that one developer’s work interferes with the work of another. Of course one day their work will have [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>When multiple developers are working in parallel (at the same build, but working in different parts) it is very common to use branches at source control, to keep each developer working in isolation and eliminating any chance that one developer’s work interferes with the work of another. Of course one day their work will have to be integrated, and that is the moment when things can go wrong. The following article proposes one of many possible setups to enable that isolation.</p>
<p>Creating a branch from another branch is very simple and easy. When working with a Continuous Integration system, however, your branch is supposed to be monitored, built and deployed to a place people can access and test it.</p>
<h2>A branch and its servers with Continuous Integration</h2>
<p>The following image illustrates a scenario where multiple developers are working at the same branch, and a second branch is used as a basis to deployments. The blue boxes at the right represents servers with specific purposes. Being now a Sitecore good practice to develop and test in scaled environment, all environments will have two nodes, one for Content Management (CM) and another for Content Delivery (CD).</p>
<p><a href="http://blog.peplau.com.br/wp-content/uploads/01-All-in-the-same-branch.png"><img class="alignnone size-full wp-image-504" src="http://blog.peplau.com.br/wp-content/uploads/01-All-in-the-same-branch.png" alt="01 - All in the same branch" width="957" height="248" /></a></p>
<p>The Continuous Integration server monitors the branch “All developers” and deploys changes to DEV (at every change) and QA (manually). When the time for a deployment comes, the work is merged to Deploy Branch. The Continuous Integration server will then make the last integration to the servers “Deploy-CM” and “Deploy-CD”, where things can be tested for the last time before the actual deployment.</p>
<p><b>The Problem with this approach</b> is that all developers are pushing their modifications to the very same branch, and thus deployments must carry everything at that branch (except of course, if very granular merges are made, but that can also be tricky and error-prone). To enable a better safe separation, the following setup is proposed.</p>
<h2>Multiple Branches</h2>
<p>The image below now shows a second branch, with its respective DEV and QA servers. Now each developer can make their work at their own branch, keeping a physical separation that guarantees one developer’s work won’t interfere with the other.<br />
<a href="http://blog.peplau.com.br/wp-content/uploads/02-Two-DEV-branches.png"><img class="alignnone size-full wp-image-505" src="http://blog.peplau.com.br/wp-content/uploads/02-Two-DEV-branches.png" alt="02 - Two DEV branches" width="887" height="249" /></a></p>
<p>The image also shows that branch “Dev1” (the older branch) were used to create branch “Dev2”, which guarantees that both branches are identical at that point in time. Obviously, each branch will have their modifications from that time on, and the code integration is now a bit harder to be executed. As time passes, each branch will be more and more different, bringing the need to a more careful exercise during the integration, executed at the “Deploy” branch.</p>
<h2>Deployments and Reverse Merges</h2>
<p>When all developers were working at the same branch, the act of checking in their changes were the integration itself. Continuous Integration server would push it to the servers, and integrations were continuously made due to the same code base. But now with physically separated branches, developers must communicate and keep their branches as much in sync as possible. The following images shows a sequence of deployments and reverse merges, that would keep both Dev branches in sync while sustaining their separations.</p>
<p><b>Image 1 &#8211; First Deployment (by Dev1) and Reverse Merge (by Dev2)</b></p>
<p><a href="http://blog.peplau.com.br/wp-content/uploads/03-First-Deploy.png"><img class="alignnone size-full wp-image-506" src="http://blog.peplau.com.br/wp-content/uploads/03-First-Deploy.png" alt="03 - First Deploy" width="887" height="567" /></a></p>
<p><b>Image 2 &#8211; Second Deployment (by Dev1) and Reverse Merge (by Dev2)</b></p>
<p><a href="http://blog.peplau.com.br/wp-content/uploads/04-Second-Deploy.png"><img class="alignnone size-full wp-image-507" src="http://blog.peplau.com.br/wp-content/uploads/04-Second-Deploy.png" alt="04 - Second Deploy" width="887" height="525" /></a></p>
<p><b>Image 3 &#8211; First Deployment (by Dev2) and Reverse Merge (by Dev1)</b></p>
<p><a href="http://blog.peplau.com.br/wp-content/uploads/05-Third-Deploy.png"><img class="alignnone size-full wp-image-508" src="http://blog.peplau.com.br/wp-content/uploads/05-Third-Deploy.png" alt="05 - Third Deploy" width="887" height="479" /></a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.peplau.com.br/developers-working-in-parallel-with-continuous-integration-builds-for-dev-and-qa/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Avoiding IIS Restarts in a separated code environment, now with Sitecore Rocks</title>
		<link>http://blog.peplau.com.br/avoiding-iis-restarts-in-a-separated-code-environment-now-with-sitecore-rocks/</link>
		<comments>http://blog.peplau.com.br/avoiding-iis-restarts-in-a-separated-code-environment-now-with-sitecore-rocks/#comments</comments>
		<pubDate>Fri, 18 Sep 2015 23:03:47 +0000</pubDate>
		<dc:creator><![CDATA[Rodrigo Peplau]]></dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Sitecore Rocks]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://blog.peplau.com.br/?p=239</guid>
		<description><![CDATA[<div class="lr_horizontal_share" data-share-url="http://blog.peplau.com.br/avoiding-iis-restarts-in-a-separated-code-environment-now-with-sitecore-rocks/"></div>This post is to bring some recent experiences from my last projects, as a continuation of my post &#8220;Avoiding IIS restarts with Robocopy in a Post Build event&#8220;. At that time I was proposing a post-building event triggering robocopy, which did the trick for that particular situation. Some time later I had access at my team to &#8220;CopySauce&#8221;, a software that keeps watching [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>This post is to bring some recent experiences from my last projects, as a continuation of my post &#8220;<a title="Avoiding IIS restarts with Robocopy in a Post Build event" href="http://blog.peplau.com.br/visual-studio-solution-at-sitecore-projects-avoiding-iis-restarts-with-robocopy-in-a-post-build-event/" target="_blank">Avoiding IIS restarts with Robocopy in a Post Build event</a>&#8220;.</p>
<p>At that time I was proposing a post-building event triggering robocopy, which did the trick for that particular situation. Some time later I had access at my team to &#8220;CopySauce&#8221;, a software that keeps watching your code base for changes, deploying immediately after the change is detected. Interestingly, a couple weeks after that <a class="url" href="http://www.seanholmesby.com/" target="_blank" rel="external nofollow">Sean Holmesby</a> (author of CopySauce) commented on my post, suggesting his tool as an alternative for Robocopy.</p>
<p>One thing that I like with that approach is the file auto-deployment, because it very nicely mimics what was (in my opinion) the only advantage of that old strategy of having both your solution code and the sitecore webapp at the same place: avoiding IIS restarts when changing non-compiled files (JS, CSS, markup, etc). And better than Robocopy, this won&#8217;t even require a compilation to be triggered &#8211; files are transferred when you save it.</p>
<h3>Sitecore Rocks &#8211; Folder Syncronization</h3>
<p>The only issue I have with that is the obvious need to start CopySauce to have it acting. Since we are already using Sitecore Rocks for some development tasks, as soon as I knew about the existence of a native feature that is similar to CopySauce I decided to give it a chance. If you already have Sitecore Rocks installed in your Visual Studio then you have all you need to start working.</p>
<h3>Setup of your solution</h3>
<p>Configuring the folder synchronization on your solution is a bit different than CopySauce &#8211; instead of having a XML file Sitecore Rocks offers you some visual aids integrated to Visual Studio. Please check the <a title="Sitecore Rocks Folder Syncronization" href="https://github.com/JakobChristensen/Sitecore.Rocks.Docs/blob/gh-pages/Tools/FolderSynchronization.md" target="_blank">official documentation</a> for details on how to properly configure your project.</p>
<div id="attachment_248" style="width: 738px" class="wp-caption alignnone"><a href="http://blog.peplau.com.br/wp-content/uploads/FolderSynchronization1.png"><img class="wp-image-248 size-full" src="http://blog.peplau.com.br/wp-content/uploads/FolderSynchronization1.png" alt="You can specify what folders in your solution to start syncronizing with the right click menu" width="728" height="452" /></a><p class="wp-caption-text">You can specify what folders in your solution to start syncronizing with the right click menu</p></div>
<div id="attachment_250" style="width: 394px" class="wp-caption alignnone"><a href="http://blog.peplau.com.br/wp-content/uploads/FolderSynchronization3.png"><img class="wp-image-250 size-full" src="http://blog.peplau.com.br/wp-content/uploads/FolderSynchronization3.png" alt="Then select one of the two syncronization methods" width="384" height="196" /></a><p class="wp-caption-text">Then select one of the two syncronization methods</p></div>
<h3>Folder Synchronization &#8211; literally</h3>
<p>One thing which in my opinion is a weak of this tool is that, as it own name states, it can only be used to keep folders synchronized. As a consequence, you cannot keep files at the root in sync between solution and the webapp, having to manually deploy these.</p>
<p>This would typically affect you web.config at least, so avoid placing things that frequently changes in your solution at the root folder of your Website project.</p>
<div id="attachment_254" style="width: 244px" class="wp-caption alignnone"><a href="http://blog.peplau.com.br/wp-content/uploads/VS-Solution-Sync-Folders.png"><img class="wp-image-254 size-full" src="http://blog.peplau.com.br/wp-content/uploads/VS-Solution-Sync-Folders.png" alt="VS Solution Sync Folders" width="234" height="283" /></a><p class="wp-caption-text">Only folders can be kept in sync</p></div>
<div id="attachment_257" style="width: 864px" class="wp-caption alignnone"><a href="http://blog.peplau.com.br/wp-content/uploads/VS-Sync-project-Setup.png"><img class="wp-image-257 size-full" src="http://blog.peplau.com.br/wp-content/uploads/VS-Sync-project-Setup.png" alt="VS Sync project Setup" width="854" height="346" /></a><p class="wp-caption-text">At the solutions I&#8217;ve tested these are the folders I had to keep in sync to start taking advantage of the tool</p></div>
<h3>Performance</h3>
<p>The tool also starts deploying your changes as soon as you save it, although I have noticed sometimes a certain delay, generally not bigger than 10 seconds tho, which is acceptable compared to a normal build.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.peplau.com.br/avoiding-iis-restarts-in-a-separated-code-environment-now-with-sitecore-rocks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Advanced display of SVG Images in Sitecore</title>
		<link>http://blog.peplau.com.br/advanced-display-of-svg-images-in-sitecore/</link>
		<comments>http://blog.peplau.com.br/advanced-display-of-svg-images-in-sitecore/#comments</comments>
		<pubDate>Fri, 31 Jul 2015 23:56:39 +0000</pubDate>
		<dc:creator><![CDATA[Rodrigo Peplau]]></dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Experience Editor]]></category>
		<category><![CDATA[Front-end]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.peplau.com.br/?p=219</guid>
		<description><![CDATA[<div class="lr_horizontal_share" data-share-url="http://blog.peplau.com.br/advanced-display-of-svg-images-in-sitecore/"></div>SVG Images are basically vector images (coordinates, objects and properties) with data that can be manipulated with CSS styling &#8211; check out this article for details on how that works. In short, to take advantage of CSS styling over SVG files, you must throw the XML content of the SVG file, directly into the HTML markup. So instead of the traditional [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>SVG Images are basically vector images (coordinates, objects and properties) with data that can be manipulated with CSS styling &#8211; check out <a href="https://css-tricks.com/using-svg/" target="_blank">this article</a> for details on how that works.</p>
<p>In short, to take advantage of CSS styling over SVG files, you must throw the XML content of the SVG file, directly into the HTML markup. So instead of the traditional &lt;img tag:</p>
<pre>&lt;img src="image.svg"</pre>
<p>You must throw inline the content of the SVG file, which will be something like:</p>
<pre>&lt;svg ...&gt; &lt;ellipse class="chair" .../&gt; <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>svg</span><span class="token punctuation">&gt;</span></span></pre>
<p>In Sitecore that means you can&#8217;t use the standard <strong>sc:Image</strong> control to render the content of an Image Field &#8211; that will render your SVG as an &lt;img HTML tag, which can&#8217;t be touched by CSS styling&#8230;</p>
<p><strong>Usercontrol</strong></p>
<p>In order to have something that is compatible both with CSS Styling and Sitecore&#8217;s Page Editor mode, my proposal is to have a custom asp usercontrol like this:</p>
<p><em><strong>Image.ascx</strong></em></p>
<pre>&lt;%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Image.ascx.cs" Inherits="Layouts.UserControls.Image" %&gt;
&lt;sc:Image runat="server" ID="scImage" /&gt;
&lt;asp:Literal runat="server" ID="litImage"&gt;&lt;/asp:Literal&gt;</pre>
<p><em><strong> Image.ascx.cs (Codebehind)</strong></em></p>
<pre>namespace Layouts.UserControls
{
 public partial class Image : UserControl
 {
   /// &lt;summary&gt;
   /// Component's Field
   /// &lt;/summary&gt;
   public string Field { get; set; }</pre>
<pre>   /// &lt;summary&gt;
   /// Component's Item (Default=Context)
   /// &lt;/summary&gt;
   public Item Item
   {
      get { return _item ?? Sitecore.Context.Item; }
      set { _item = value; }
   }
   private Item _item;</pre>
<pre>   protected void Page_Load(object sender, EventArgs e)
   {
     // When editing in Page Editor mode, always use an &lt;sc:image
     // If no field is set, escape and let it break
     if (Sitecore.Context.PageMode.IsPageEditorEditing || string.IsNullOrEmpty(Field))
     {
        ShowScImage();
        return;
     }</pre>
<pre>     // Escape if field is not found
     var referencedImageField = (Sitecore.Data.Fields.ImageField)Item.Fields[Field];
     if (referencedImageField == null)
     {
       ShowScImage();
       return;
     }</pre>
<pre>     // Get referenced image - Scape if image is not found
     var imageItem = referencedImageField.MediaItem;
     if (imageItem == null)
     {
        ShowScImage();
        return;
     }</pre>
<pre>     // If this is not an svg use a normal &lt;sc:Image
     var imageMediaItem = (MediaItem) imageItem;
     if (!imageMediaItem.Extension.ToLower().Contains("svg"))
     {
        ShowScImage();
        return;
     }</pre>
<pre>     ShowSvgImage(imageMediaItem);
 }</pre>
<pre> public static string GetMediaUrlWithServer(MediaItem mediaItem, Item item = null)
 {
    item = item ?? Sitecore.Context.Item;
    var options = new UrlOptions { AlwaysIncludeServerUrl = true, AddAspxExtension = false };
    var itemUrl = LinkManager.GetItemUrl(item, options);
    var mediaOptions = new MediaUrlOptions { AbsolutePath = true };
    var mediaUrl = MediaManager.GetMediaUrl(mediaItem, mediaOptions);
    return itemUrl + mediaUrl;
 }</pre>
<pre> private void ShowSvgImage(MediaItem mediaItem)
 {
    litImage.Visible = true;
    scImage.Visible = false;</pre>
<pre>    // Get string from Image Stream
    var stream = mediaItem.GetMediaStream();
    var reader = new StreamReader(stream);
    var svgString = reader.ReadToEnd();
    reader.Close();
    stream.Close();</pre>
<pre>    // Get SVG tag from string</pre>
<pre>    // No SVG tag found - fallback to &lt;sc:Image
    if (!svgString.Contains("&lt;svg"))
    {
       ShowScImage();
       return;
    }</pre>
<pre>    svgString = svgString.Substring(svgString.IndexOf("&lt;svg",StringComparison.Ordinal));
    litImage.Text = svgString;
 }</pre>
<pre> private void ShowScImage()
 {
    litImage.Visible = false;
    scImage.Visible = true;</pre>
<pre>    scImage.Item = Item;
    scImage.Field = Field;
    ReflectAttributesToControl(scImage); 
 }</pre>
<pre> private void ReflectAttributesToControl(WebControl control)
 {
    foreach (string key in Attributes.Keys)
     control.Attributes[key] = Attributes[key];
 }
}</pre>
<p><strong>Streaming</strong></p>
<p>The proposed solution makes use of Streaming for better performance, so rendering times are not affected.</p>
<p><strong>How to Use</strong></p>
<p>Now we have our custom image rendering control that renders inline SVG images when you are in Preview or Normal mode, and is compatible with Sitecore&#8217;s Page Editor mode.</p>
<p>To use, first you have to register the Usercontrol:</p>
<pre>&lt;%@ Register TagPrefix="custom" TagName="Image" Src="~/layouts/UserControls/Image.ascx" %&gt;</pre>
<p>Then use it just like you&#8217;d do with a standard sc:Image control:</p>
<pre>&lt;custom:Image runat="server" ID="imgSvgImage" Field="My Field Name" /&gt;</pre>
<p>At the code behind you can also access the properties &#8220;Field&#8221; and &#8220;Item&#8221; just like the normal Image control:</p>
<pre>imgClear.Item = Sitecore.Context.Item;</pre>
<p>And that&#8217;s all!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.peplau.com.br/advanced-display-of-svg-images-in-sitecore/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Best way to setup Active Directory Module in a Sitecore Solution</title>
		<link>http://blog.peplau.com.br/best-way-to-setup-active-directory-module-in-a-sitecore-solution/</link>
		<comments>http://blog.peplau.com.br/best-way-to-setup-active-directory-module-in-a-sitecore-solution/#comments</comments>
		<pubDate>Mon, 23 Mar 2015 22:37:40 +0000</pubDate>
		<dc:creator><![CDATA[Rodrigo Peplau]]></dc:creator>
				<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[LDAP]]></category>
		<category><![CDATA[Sitecore Modules]]></category>

		<guid isPermaLink="false">http://blog.peplau.com.br/?p=157</guid>
		<description><![CDATA[<div class="lr_horizontal_share" data-share-url="http://blog.peplau.com.br/best-way-to-setup-active-directory-module-in-a-sitecore-solution/"></div>Connecting Sitecore with an LDAP Server is pretty easy with Sitecore&#8217;s Active Directory Module. Setting up the module is not hard, but if you follow the official documentation you&#8217;ll end up updating a lot of your Web.config file, which may be a problem for several reasons: You can easily lose track on your customizations; Upgrading Sitecore for a newer version may become [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Connecting Sitecore with an LDAP Server is pretty easy with Sitecore&#8217;s <a href="http://sdn.sitecore.net/Products/AD.aspx" target="_blank">Active Directory Module</a>. Setting up the module is not hard, but if you follow <a href="http://sdn.sitecore.net/Products/AD/AD12/Documentation.aspx" target="_blank">the official documentation</a> you&#8217;ll end up updating a lot of your Web.config file, which may be a problem for several reasons:</p>
<ol>
<li>You can easily lose track on your customizations;</li>
<li>Upgrading Sitecore for a newer version may become harder;</li>
<li>During development you may be forced to turn your LDAP module off, basically undoing the setup of your providers, which is not straight-forward.</li>
</ol>
<p>After facing these issues a couple times I decided to look for a better approach.</p>
<p><strong>Using Includes</strong></p>
<p>Biggest limitation is by far the need to update your Web.config, as the changes are not in the Sitecore portion and thus cannot be automatically patched by files in your <em>/App_Config/Include</em> folder. Best you can do is to create patches with the configurations, then include them at the Web.config.</p>
<p><strong>Step by step</strong></p>
<ol>
<li>Add the LDAP connection settings to your ConnectionStrings.config:<br />
<blockquote><p>&lt;add name=&#8221;ManagersConnString&#8221; connectionString=&#8221;LDAP://yourldapserver.com:389/DC=your,DC=domain&#8221; /&gt;</p></blockquote>
</li>
<li>At your Web.config, find your <em>&lt;system.web&gt;</em> section and comment out your <em>&lt;membership&gt;</em>, <em>&lt;roleManager&gt;</em> and <em>&lt;profile&gt;</em> nodes &#8211; these will be all replaced by includes;</li>
<li>At the same level you commented out, add a &lt;machineKey&gt; node as covered at the official documentation:<br />
<blockquote><p>  &lt;machineKey validationKey=&#8221;BDDFE367CD36AAA81E195761BEFB073839549FF7B8E34E42C0DEA4600851B0065856B211719ADEFC76F3F3A556BC61A5FC8C9F28F958CB1D3BD8EF9518143DB6&#8243; decryptionKey=&#8221;0DAC68D020B8193DF0FCEE1BAF7A07B4B0D40DCD3E5BA90D&#8221; validation=&#8221;SHA1&#8243; /&gt;</p></blockquote>
</li>
<li>Still at this level let&#8217;s add three includes for Membership, RoleManager and Profile providers:<br />
<blockquote><p>&lt;!&#8211; Includes &#8211;&gt;<br />
&lt;membership configSource=&#8221;App_Config\AD\Membership.config&#8221; /&gt;<br />
&lt;roleManager configSource=&#8221;App_Config\AD\RoleManager.config&#8221; /&gt;<br />
&lt;profile configSource=&#8221;App_Config\AD\Profile.config&#8221; /&gt;</p></blockquote>
</li>
<li>As well as the three includes for disabling the module. We let it commented for now, which makes the module enabled:<br />
<blockquote><p>&lt;!&#8211;<br />
&lt;membership configSource=&#8221;App_Config\AD\Membership_Disabled.config&#8221; /&gt;<br />
&lt;roleManager configSource=&#8221;App_Config\AD\RoleManager_Disabled.config&#8221; /&gt;<br />
&lt;profile configSource=&#8221;App_Config\AD\Profile_Disabled.config&#8221; /&gt;<br />
&#8211;&gt;</p></blockquote>
</li>
<li>You have also to add your mapped domain(s) to <em>App_Config\Security\Domains.config</em>:<br />
<blockquote><p>&lt;domain name=&#8221;ad&#8221; ensureAnonymousUser=&#8221;false&#8221;/&gt;</p></blockquote>
</li>
<li>Now create a folder called &#8220;AD&#8221; at App_Config and drop the six config files that are zipped at this link:<br />
&#8211; <a href="http://blog.peplau.com.br/wp-content/uploads/AD-configs.rar">AD-configs</a> &#8211; Don&#8217;t forget to review all files (except the &#8220;_Disabled.config&#8221; that stores the native Sitecore configurations) to make sure you username, password and domains are corretly set!</li>
</ol>
<p>Now when you want to turn the module off you just have to comment out the lines from #4 and uncomment #5 &#8211; pretty easy.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.peplau.com.br/best-way-to-setup-active-directory-module-in-a-sitecore-solution/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How would you do it: 2 levels menu</title>
		<link>http://blog.peplau.com.br/how-would-you-do-2-levels-menu/</link>
		<comments>http://blog.peplau.com.br/how-would-you-do-2-levels-menu/#comments</comments>
		<pubDate>Mon, 09 Feb 2015 20:24:17 +0000</pubDate>
		<dc:creator><![CDATA[Rodrigo Peplau]]></dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[How To]]></category>

		<guid isPermaLink="false">http://blog.peplau.com.br/?p=57</guid>
		<description><![CDATA[<div class="lr_horizontal_share" data-share-url="http://blog.peplau.com.br/how-would-you-do-2-levels-menu/"></div>One of our clients has a development team that will take over the project as soon as we finish our part. They have great developers with no Sitecore experience, and some of their questions are pretty valuable for those starting in the Sitecore world. My answer that follows has a consultancy approach, providing explanations and advises at a higher level. [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>One of our clients has a development team that will take over the project as soon as we finish our part. They have great developers with no Sitecore experience, and some of their questions are pretty valuable for those starting in the Sitecore world. My answer that follows has a consultancy approach, providing explanations and advises at a higher level.</p>
<p>Here is the question:</p>
<blockquote><p>In Sitecore, how would you organize architecture and static files &#8211; mainly CSS and javascript files &#8211; during development of the following two levels menu?</p>
<p>The first level shows an Image and a Title and starts closed:<br />
<a href="http://blog.peplau.com.br/wp-content/uploads/Menu2l-closed.png"><img class=" wp-image-58 alignnone" src="http://blog.peplau.com.br/wp-content/uploads/Menu2l-closed.png" alt="Menu2l - closed" width="600" height="140" /></a></p>
<p>When the user hovers a block at Level 1, a second part is displayed showing items on Level 2:<a href="http://blog.peplau.com.br/wp-content/uploads/Menu2l-hover1.png"><img class=" wp-image-64 alignnone" src="http://blog.peplau.com.br/wp-content/uploads/Menu2l-hover1.png" alt="Menu2l - hover" width="600" height="421" /></a></p></blockquote>
<p><strong>Answer</strong></p>
<p>Your static CSS and Javascript files, like in any other web application, must be loaded somehow. At the project we are working, we have a <a href="https://msdn.microsoft.com/en-us/magazine/dn451436.aspx" target="_blank">bundle and minification</a> process in place, responsible for loading, minify&#8217;ing and caching the files so everything loads faster.</p>
<p>But you can load files the old way:</p>
<blockquote>
<pre>&lt;script src="myscript.js" type="text/javascript"&gt;&lt;/script&gt;</pre>
</blockquote>
<p>The implementation itself can be split into two different challenges:</p>
<ol>
<li><strong>Front-end development</strong><br />
We clearly have a good front-end work here, some dynamic behavior when user hovers around level 1, the look and feel and everything. Basically all HTML markup, javascript and css stylesheets can be prepared without having Sitecore specifically in mind;</li>
<li><strong>Back end development</strong><br />
All necessary to enable the content edition of menu items, and make it work dynamically at a page, including:</p>
<ul>
<li><strong>Step 1 -</strong> Upload your javascript and CSS files somewhere at your site filesystem (Eg: &#8220;<em>/assets/js</em>&#8221; and &#8220;<em>/assets/css</em>&#8220;), then load them somehow (traditional, bundle, etc);</li>
<li><strong>Step 2 -</strong> Define your data structure (templates and fields) to support the content management. It all depends on your requirements &#8211; let&#8217;s have the following two possible scenarios:
<ul>
<li><strong>Scenario 1 -</strong> You may want to feed the menu with pages and subpages you already have in your content tree. In this case you would just use your existing data:<br />
<a href="http://blog.peplau.com.br/wp-content/uploads/Menu-Tree.png"><img class=" size-full wp-image-68 alignnone" src="http://blog.peplau.com.br/wp-content/uploads/Menu-Tree.png" alt="Menu Tree" width="159" height="139" /></a></li>
<li><strong>Scenario 2 -</strong> Or you may be asked to create a dedicated data structure, not pages themselves but pointing to real pages. This data structure would have the following format:<br />
<strong>Menu Item Level 1</strong><br />
<a href="http://blog.peplau.com.br/wp-content/uploads/Sitecore-Template-Menu-Level-11.png"><img class="alignnone  wp-image-71" src="http://blog.peplau.com.br/wp-content/uploads/Sitecore-Template-Menu-Level-11.png" alt="Sitecore Template Menu Level 1" width="462" height="106" /></a><strong>Menu Item Level 2</strong><br />
<a href="http://blog.peplau.com.br/wp-content/uploads/Sitecore-Template-Menu-Level-21.png"><img class="alignnone  wp-image-72" src="http://blog.peplau.com.br/wp-content/uploads/Sitecore-Template-Menu-Level-21.png" alt="Sitecore Template Menu Level 2" width="463" height="130" /></a>And you would keep the item somewhere outside your page&#8217;s content tree:<br />
<a href="http://blog.peplau.com.br/wp-content/uploads/Menu-Tree-2.png"><img class="alignnone size-full wp-image-74" src="http://blog.peplau.com.br/wp-content/uploads/Menu-Tree-2.png" alt="Menu Tree 2" width="164" height="141" /></a></li>
</ul>
</li>
<li><strong>Step 3 -</strong> Create the component/sublayout that implements the menu feature. Following the same two scenarios above:
<ul>
<li><strong>Scenario 1 -</strong> In this case you would use the Sitecore API to pragmatically get the Home item, using Children items to render menu&#8217;s level 1, and their grandchildren rendering level 2:
<pre>var homeItem = Sitecore.Context.Database.GetItem("/sitecore/content/Home");
var levelOne = homeItem.Children.ToList();
foreach (var itemLevelOne in levelOne) {
   // This item represents a Level 1 menu block
   var title = itemLevelOne.Fields["Title"].Value;
   var image = itemLevelOne.Fields["Image"].Value;
   var levelTwo = itemLevelOne.Children.ToList();
   // ... do whatever you need with Level 1
   foreach (var itemLevelTwo in levelTwo) {
      // Here you work your Level 2 item
      var titleLevelTwo = itemLevelTwo.Fields["Title"].Value;
   }
}</pre>
</li>
<li><strong>Scenario 2 -</strong> This implementation would be very similar to the first scenario, except that you would have to start at your repository folder (Eg: <em>/sitecore/content/Lists/Menu</em>) instead of the Home item.</li>
</ul>
</li>
</ul>
</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blog.peplau.com.br/how-would-you-do-2-levels-menu/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
