<?xml version="1.0" encoding="utf-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><language>en</language><title>Blog posts by Tuan  Truong</title> <link>https://world.optimizely.com/blogs/Tuan--Truong/</link><description></description><ttl>60</ttl><generator>Optimizely World</generator><item> <title>EPiImage &amp; EPiImage Gallery dojo-based custom property for EPiServer 7.5 and above</title>            <link>https://world.optimizely.com/blogs/Tuan--Truong/Dates/2014/6/EPiImage--EPiImage-Gallery-dojo-based-custom-property-for-EPiServer-75-and-above/</link>            <description>&lt;p&gt;Upon the heavily uses of the popular MakingWaves EPiImage gallery property , I have decided to put some of the effort to upgrade the property from old school jquery based on EPiServer 6 on to EPiServer 7. This was at the same time as a good exercise to help started with Dojo development. Furthermore,&amp;#160; since the VPP is no longer used, and replaced with media content on EPiServer 7.5, with the help from others I have also managed to upgrade the property, so that it is compatible with the latest assets management system. Drag and drop images from assets management is also added on to this new release. &lt;/p&gt;  &lt;p&gt;Following the philisopy of contributing back to the community, I hope this could provide back some benefits for other EPiServer developer&lt;/p&gt;  &lt;p&gt;Properties values are also stored in the same format as the original values so that they could be easily migrated. Here are the list of items within the project:&lt;/p&gt;  &lt;p&gt;Here is the structure view of the project:&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;/link/3695fdc509674fc1a2d41ac8519734a3.png&quot;&gt;&lt;img title=&quot;EPiImage&quot; style=&quot;border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px&quot; border=&quot;0&quot; alt=&quot;EPiImage&quot; src=&quot;/link/55c0fea9fb824f0fb018dbe63002dcdb.png&quot; width=&quot;540&quot; height=&quot;469&quot; /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;From top to bottom:&lt;/p&gt;  &lt;p&gt;1. Templates Folder store all the html templates for the controls used for EPiImage and EPiImage Gallery Property controls. EPiImageInfoForm is to allow user to edit image title, description, and image link. Here is how the form will look like:&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;/link/77b13c2c29db44a7bcac695708bf00b4.png&quot;&gt;&lt;img title=&quot;EPiImageInfoEdit&quot; style=&quot;border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px&quot; border=&quot;0&quot; alt=&quot;EPiImageInfoEdit&quot; src=&quot;/link/72a89f64c9454c88930e9c87b46c20e3.png&quot; width=&quot;279&quot; height=&quot;328&quot; /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;On most of the project that requires Image Gallery property, it is found that you usually need these information for the images, .i.e. to be used for slideshow. &lt;/p&gt;  &lt;p&gt;2. EPiImage.js , EPiIMageGallery.js&lt;/p&gt;  &lt;p&gt;These files store the client logic implementation of the editing control for EPiImage &amp;amp; EPiImage Gallery properties. Digging in to the code, you could see that they are based on a lot of diiferent dojo and EPi-dojo controls&lt;/p&gt;  &lt;p&gt;3. EPiImageInfoForm&lt;/p&gt;  &lt;p&gt;This is to handle the client side logic for the above editing image infor form&lt;/p&gt;  &lt;p&gt;4. ModuleInitializer &amp;amp; RequireModule&lt;/p&gt;  &lt;p&gt;These files are responsible to initialize the connection to the Rest Store Controller on the server side, so that the client control could send request back to the server side.&lt;/p&gt;  &lt;p&gt;5. EPiImageGalleryProperty, EPiIMageProperty, EPiImageEditorDescriptot, EPiIMageGalleryEditorDescriptor.&lt;/p&gt;  &lt;p&gt;These files are responsible for custom property declaration, serialize data, and declare the editor template for the properties. &lt;/p&gt;  &lt;p&gt;6. ImageFile on Media Folder&lt;/p&gt;  &lt;p&gt;Since EPiServer 7.5, all asset must be based on an image content data class, therefore we will need one for our images as well. Please feel free to remove this file from your copy if you already had one on your project.&lt;/p&gt;  &lt;p&gt;7. EPiImageStore &lt;/p&gt;  &lt;p&gt;This class is responsible for getting the image info from Content Data Store. This is inherited from RestControllerBase , that available from EPiServer 7.&lt;/p&gt;  &lt;p&gt;8. Module.config&lt;/p&gt;  &lt;p&gt;You will need to copy the bits that needed from within this module.config file on to your project, to get the properties working:&lt;/p&gt;  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;&amp;lt;assemblies&amp;gt;
    &amp;lt;add &lt;span class=&quot;kwrd&quot;&gt;assembly&lt;/span&gt;=&lt;span class=&quot;str&quot;&gt;&amp;quot;EPiImage&amp;quot;&lt;/span&gt; /&amp;gt;
  &amp;lt;/assemblies&amp;gt;
  &amp;lt;clientResources&amp;gt;
    &amp;lt;add name=&lt;span class=&quot;str&quot;&gt;&amp;quot;epiimage.editors.style&amp;quot;&lt;/span&gt; path=&lt;span class=&quot;str&quot;&gt;&amp;quot;Styles/imagegallery.css&amp;quot;&lt;/span&gt; resourceType=&lt;span class=&quot;str&quot;&gt;&amp;quot;Style&amp;quot;&lt;/span&gt; /&amp;gt;
  &amp;lt;/clientResources&amp;gt;
  &amp;lt;dojo&amp;gt;
    &amp;lt;!-- Add a mapping from alloy &lt;span class=&quot;kwrd&quot;&gt;to&lt;/span&gt; ~/ClientResources/Scripts &lt;span class=&quot;kwrd&quot;&gt;to&lt;/span&gt; the dojo loader configuration --&amp;gt;
    &amp;lt;paths&amp;gt;
      &amp;lt;add name=&lt;span class=&quot;str&quot;&gt;&amp;quot;app&amp;quot;&lt;/span&gt; path=&lt;span class=&quot;str&quot;&gt;&amp;quot;Scripts&amp;quot;&lt;/span&gt; /&amp;gt;
      &amp;lt;add name=&lt;span class=&quot;str&quot;&gt;&amp;quot;epiimage&amp;quot;&lt;/span&gt; path=&lt;span class=&quot;str&quot;&gt;&amp;quot;Scripts/EPiImage/&amp;quot;&lt;/span&gt; /&amp;gt;
    &amp;lt;/paths&amp;gt;
  &amp;lt;/dojo&amp;gt;
  &amp;lt;clientModule initializer=&lt;span class=&quot;str&quot;&gt;&amp;quot;app.ModuleInitializer&amp;quot;&lt;/span&gt;&amp;gt;
    &amp;lt;requiredResources&amp;gt;
      &amp;lt;add name=&lt;span class=&quot;str&quot;&gt;&amp;quot;epiimage.editors.style&amp;quot;&lt;/span&gt;/&amp;gt;
    &amp;lt;/requiredResources&amp;gt;
  &amp;lt;/clientModule&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;style type=&quot;text/css&quot;&gt;












.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, &quot;Courier New&quot;, courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;For the above config:&lt;/p&gt;

&lt;p&gt;8.1. Fist block,add assembly to generate the url for EpiImageStore, which is declared as a Rest Store, to get the file info from the server back to the client.&lt;/p&gt;

&lt;p&gt;8.2. Second block, the client resources are for module initializer, and css that will be used for our properties.&lt;/p&gt;

&lt;p&gt;8.3. . Third block, the dojo module is to define the namespace for Scripts folder that will be used for EPI Image/Gallery client editor.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Here is how the image gallery property will look like on the back-end :&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/link/f0921c24bf1a43728886d32d9bcfd2c6.png&quot;&gt;&lt;img title=&quot;ImageGalleryProperty&quot; style=&quot;border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px&quot; border=&quot;0&quot; alt=&quot;ImageGalleryProperty&quot; src=&quot;/link/fd18a8f159ef4929bc429f865a32687d.png&quot; width=&quot;706&quot; height=&quot;300&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When editing the image collection, user will has the ability drag and drop images from media assets to the add image box as well.&lt;/p&gt;

&lt;p&gt;Here is how the properties can be called on the fron-end:&lt;/p&gt;

&lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;@&lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (Model.ImageCollection != &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;)
    {
        &lt;span class=&quot;kwrd&quot;&gt;foreach&lt;/span&gt; (EPiImageGalleryImage image &lt;span class=&quot;kwrd&quot;&gt;in&lt;/span&gt; Model.ImageCollection)
        {
            &amp;lt;a &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt;=&lt;span class=&quot;str&quot;&gt;&amp;quot;image_view&amp;quot;&lt;/span&gt; href=&lt;span class=&quot;str&quot;&gt;&amp;quot;@Url.ContentUrl(image.ImageUrl)&amp;quot;&lt;/span&gt; rel=&lt;span class=&quot;str&quot;&gt;&amp;quot;lightbox&amp;quot;&lt;/span&gt;&amp;gt;&amp;lt;img src=&lt;span class=&quot;str&quot;&gt;&amp;quot;@Url.ContentUrl(image.ImageUrl)&amp;quot;&lt;/span&gt; /&amp;gt;&amp;lt;/a&amp;gt;
        }
    }&lt;/code&gt;&lt;/pre&gt;
&lt;style type=&quot;text/css&quot;&gt;












.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, &quot;Courier New&quot;, courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;This could also be used on Webform project without any problems.&lt;/p&gt;

&lt;p&gt;A screencast on how the property works could be found here: &lt;a title=&quot;http://www.screencast.com/t/IPVCO5OmPtPU&quot; href=&quot;http://www.screencast.com/t/IPVCO5OmPtPU&quot;&gt;http://www.screencast.com/t/IPVCO5OmPtPU&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The full source code of this project is &lt;a href=&quot;http://bit.ly/epiimage75&quot;&gt;available at here&lt;/a&gt;. If you need the sample project or any help send a request here.&lt;/p&gt;
&lt;style type=&quot;text/css&quot;&gt;


.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, &quot;Courier New&quot;, courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;</description>            <guid>https://world.optimizely.com/blogs/Tuan--Truong/Dates/2014/6/EPiImage--EPiImage-Gallery-dojo-based-custom-property-for-EPiServer-75-and-above/</guid>            <pubDate>Tue, 10 Jun 2014 16:41:01 GMT</pubDate>           <category>Blog post</category></item><item> <title>Upgrade to EPiServer Commerce 7.5 : Part 2– MVC Areas Support For EPiServer 7 &amp; above</title>            <link>https://world.optimizely.com/blogs/Tuan--Truong/Dates/2014/2/Upgrade-to-EPiServer-Commerce-75--Part-2-MVC-Areas-Support-For-EPiServer-7--above/</link>            <description>&lt;p&gt;In our company, we have a cms project framework that built on top of EPiServer CMS using asp.net MVC 4. This acts as a starting project for many of our EPiServer CMS projects consisting a lot included features, with many template blocks. However, when building Commerce or Relate project on top of our CMS project, we always wanted to separate the code base so that these pages, blocks and all the components are not in the same place as the CMS components. Therefore, implementing &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ee671793(v=vs.100).aspx&quot;&gt;MVC Areas&lt;/a&gt; was kind of the best solution for this. This however is not yet supported on EPiServer 7&amp;#160; &amp;amp; Above.     &lt;br /&gt;Nevertheless, as a saying “There is always a way”, one of our senior team member&amp;#160; came up with the solution using a custom view engine. We saw on the forum mentioning that it may be an over-killed idea, but when actually implement it, it rather quite straightforward. It gives you a lot more flexibility in handling your project structure.     &lt;br clear=&quot;all&quot; /&gt;&lt;/p&gt;  &lt;hr /&gt;  &lt;p&gt;Here is the structure that we wanted:    &lt;br clear=&quot;all&quot; /&gt;    &lt;br clear=&quot;all&quot; /&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;/link/b0810dcd4187477b9ff8b89fd2be8af8.png&quot;&gt;&lt;img title=&quot;clip_image001&quot; style=&quot;border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px&quot; border=&quot;0&quot; alt=&quot;clip_image001&quot; src=&quot;/link/558d40225a994aa0866d4c236c8a2c82.png&quot; width=&quot;181&quot; height=&quot;244&quot; /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Here is the magic bit of code that we used on our custom View engine to achieve the above:    &lt;br clear=&quot;all&quot; /&gt;&lt;/p&gt; &lt;style type=&quot;text/css&quot;&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, &quot;Courier New&quot;, courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;  &lt;div class=&quot;csharpcode&quot;&gt;   &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; NitecoViewEngine : RazorViewEngine&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;    {&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;        &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; NitecoViewEngine()&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;        {&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;            ViewLocationFormats = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt;[]&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                                      { &lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                                          &lt;span class=&quot;str&quot;&gt;&amp;quot;~/Areas/%1/Views/{1}/{0}.cshtml&amp;quot;&lt;/span&gt;,&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                                          &lt;span class=&quot;str&quot;&gt;&amp;quot;~/Areas/%1/Views/{1}/{0}.vbhtml&amp;quot;&lt;/span&gt;,&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                                           &lt;span class=&quot;str&quot;&gt;&amp;quot;~/Areas/%1/Views/&amp;quot;&lt;/span&gt; + Constants.ViewPath.PaymentMethodsFolder +  &lt;span class=&quot;str&quot;&gt;&amp;quot;/{1}/{0}.cshtml&amp;quot;&lt;/span&gt;,&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                                          &lt;span class=&quot;str&quot;&gt;&amp;quot;~/Areas/%1/Views/&amp;quot;&lt;/span&gt; + Constants.ViewPath.PaymentMethodsFolder +  &lt;span class=&quot;str&quot;&gt;&amp;quot;/{1}/{0}.vbhtml&amp;quot;&lt;/span&gt;,&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                                          &lt;span class=&quot;str&quot;&gt;&amp;quot;~/Areas/%1/Views/Shared/{0}.cshtml&amp;quot;&lt;/span&gt;,&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                                          &lt;span class=&quot;str&quot;&gt;&amp;quot;~/Areas/%1/Views/Shared/{0}.vbhtml&amp;quot;&lt;/span&gt;,&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                                          &lt;span class=&quot;str&quot;&gt;&amp;quot;~/Areas/%1/Views/{1}/{0}.cshtml&amp;quot;&lt;/span&gt;,&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                                          &lt;span class=&quot;str&quot;&gt;&amp;quot;~/Areas/%1/Views/{1}/{0}.vbhtml&amp;quot;&lt;/span&gt;,&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                                          &lt;span class=&quot;str&quot;&gt;&amp;quot;~/Areas/%1/Views/Shared/{0}.cshtml&amp;quot;&lt;/span&gt;,&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                                          &lt;span class=&quot;str&quot;&gt;&amp;quot;~/Areas/%1/Views/Shared/{0}.vbhtml&amp;quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                                      };&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;&amp;#160;&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;            MasterLocationFormats = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt;[]&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                                        { &lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                                            &lt;span class=&quot;str&quot;&gt;&amp;quot;~/Areas/%1/Views/{1}/{0}.cshtml&amp;quot;&lt;/span&gt;,&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                                            &lt;span class=&quot;str&quot;&gt;&amp;quot;~/Areas/%1/Views/{1}/{0}.vbhtml&amp;quot;&lt;/span&gt;,&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                                            &lt;span class=&quot;str&quot;&gt;&amp;quot;~/Areas/%1/Views/Shared/{0}.cshtml&amp;quot;&lt;/span&gt;,&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                                            &lt;span class=&quot;str&quot;&gt;&amp;quot;~/Areas/%1/Views/Shared/{0}.vbhtml&amp;quot;&lt;/span&gt;,&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                                            &lt;span class=&quot;str&quot;&gt;&amp;quot;~/Areas/%1/Views/{1}/{0}.cshtml&amp;quot;&lt;/span&gt;,&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                                            &lt;span class=&quot;str&quot;&gt;&amp;quot;~/Areas/%1/Views/{1}/{0}.vbhtml&amp;quot;&lt;/span&gt;,&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                                            &lt;span class=&quot;str&quot;&gt;&amp;quot;~/Areas/%1/Views/Shared/{0}.cshtml&amp;quot;&lt;/span&gt;,&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                                            &lt;span class=&quot;str&quot;&gt;&amp;quot;~/Areas/%1/Views/Shared/{0}.vbhtml&amp;quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                                        };&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;&amp;#160;&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;            PartialViewLocationFormats = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt;[]&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                                             { &lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                                                 &lt;span class=&quot;str&quot;&gt;&amp;quot;~/Views/Shared/&amp;quot;&lt;/span&gt; + Constants.ViewPath.BlockFolder + &lt;span class=&quot;str&quot;&gt;&amp;quot;/{0}.cshtml&amp;quot;&lt;/span&gt;,&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                                                 &lt;span class=&quot;str&quot;&gt;&amp;quot;~/Views/Shared/&amp;quot;&lt;/span&gt; + Constants.ViewPath.BlockFolder + &lt;span class=&quot;str&quot;&gt;&amp;quot;/{0}.vbhtml&amp;quot;&lt;/span&gt;,&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                                                 &lt;span class=&quot;str&quot;&gt;&amp;quot;~/Views/Shared/&amp;quot;&lt;/span&gt; + Constants.ViewPath.PaymentMethodsFolder + &lt;span class=&quot;str&quot;&gt;&amp;quot;/{0}.cshtml&amp;quot;&lt;/span&gt;,&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                                                 &lt;span class=&quot;str&quot;&gt;&amp;quot;~/Views/Shared/&amp;quot;&lt;/span&gt; + Constants.ViewPath.PaymentMethodsFolder + &lt;span class=&quot;str&quot;&gt;&amp;quot;/{0}.vbhtml&amp;quot;&lt;/span&gt;,&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                                                 &lt;span class=&quot;str&quot;&gt;&amp;quot;~/Views/Shared/&amp;quot;&lt;/span&gt; + Constants.ViewPath.PagePartialsFolder + &lt;span class=&quot;str&quot;&gt;&amp;quot;/{0}.cshtml&amp;quot;&lt;/span&gt;,&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                                                 &lt;span class=&quot;str&quot;&gt;&amp;quot;~/Views/Shared/&amp;quot;&lt;/span&gt; + Constants.ViewPath.PagePartialsFolder + &lt;span class=&quot;str&quot;&gt;&amp;quot;/{0}.vbhtml&amp;quot;&lt;/span&gt;,&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                                                 &lt;span class=&quot;str&quot;&gt;&amp;quot;~/Views/Shared//{0}.cshtml&amp;quot;&lt;/span&gt;,                                             &lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                                                 &lt;span class=&quot;str&quot;&gt;&amp;quot;~/Areas/%1/Views/{1}/{0}.cshtml&amp;quot;&lt;/span&gt;,&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                                                 &lt;span class=&quot;str&quot;&gt;&amp;quot;~/Areas/%1/Views/{1}/{0}.vbhtml&amp;quot;&lt;/span&gt;,&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                                                 &lt;span class=&quot;str&quot;&gt;&amp;quot;~/Areas/%1/Views/Shared/{0}.cshtml&amp;quot;&lt;/span&gt;,&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                                                 &lt;span class=&quot;str&quot;&gt;&amp;quot;~/Areas/%1/Views/Shared/{0}.vbhtml&amp;quot;&lt;/span&gt;,&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                                                 &lt;span class=&quot;str&quot;&gt;&amp;quot;~/Areas/%1/Views/{1}/{0}.cshtml&amp;quot;&lt;/span&gt;,&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                                                 &lt;span class=&quot;str&quot;&gt;&amp;quot;~/Areas/%1/Views/{1}/{0}.vbhtml&amp;quot;&lt;/span&gt;,&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                                                 &lt;span class=&quot;str&quot;&gt;&amp;quot;~/Areas/%1/Views/Shared/{0}.cshtml&amp;quot;&lt;/span&gt;,&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                                                 &lt;span class=&quot;str&quot;&gt;&amp;quot;~/Areas/%1/Views/Shared/{0}.vbhtml&amp;quot;&lt;/span&gt;,&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                                                 &lt;span class=&quot;str&quot;&gt;&amp;quot;~/Areas/%1/Views/Shared/&amp;quot;&lt;/span&gt; + Constants.ViewPath.BlockFolder + &lt;span class=&quot;str&quot;&gt;&amp;quot;/{0}.cshtml&amp;quot;&lt;/span&gt;,&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                                                 &lt;span class=&quot;str&quot;&gt;&amp;quot;~/Areas/%1/Views/Shared/&amp;quot;&lt;/span&gt; + Constants.ViewPath.BlockFolder + &lt;span class=&quot;str&quot;&gt;&amp;quot;/{0}.vbhtml&amp;quot;&lt;/span&gt;,&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                                                 &lt;span class=&quot;str&quot;&gt;&amp;quot;~/Areas/%1/Views/Shared/&amp;quot;&lt;/span&gt; + Constants.ViewPath.PaymentMethodsFolder + &lt;span class=&quot;str&quot;&gt;&amp;quot;/{0}.cshtml&amp;quot;&lt;/span&gt;,&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                                                 &lt;span class=&quot;str&quot;&gt;&amp;quot;~/Areas/%1/Views/Shared/&amp;quot;&lt;/span&gt; + Constants.ViewPath.PaymentMethodsFolder + &lt;span class=&quot;str&quot;&gt;&amp;quot;/{0}.vbhtml&amp;quot;&lt;/span&gt;,&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                                                 &lt;span class=&quot;str&quot;&gt;&amp;quot;~/Areas/%1/Views/Shared/&amp;quot;&lt;/span&gt; + Constants.ViewPath.PagePartialsFolder + &lt;span class=&quot;str&quot;&gt;&amp;quot;/{0}.cshtml&amp;quot;&lt;/span&gt;,&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                                                 &lt;span class=&quot;str&quot;&gt;&amp;quot;~/Areas/%1/Views/Shared/&amp;quot;&lt;/span&gt; + Constants.ViewPath.PagePartialsFolder + &lt;span class=&quot;str&quot;&gt;&amp;quot;/{0}.vbhtml&amp;quot;&lt;/span&gt;,&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                                                        &lt;span class=&quot;str&quot;&gt;&amp;quot;~/Views/Shared/DisplayTemplates/{0}.cshtml&amp;quot;&lt;/span&gt;,&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                                                &lt;span class=&quot;str&quot;&gt;&amp;quot;~/Views/Shared/DisplayTemplates/{0}.vbhtml&amp;quot;&lt;/span&gt;,&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                                                &lt;span class=&quot;str&quot;&gt;&amp;quot;~/Views/Shared/DisplayTemplates/{1}/{0}.cshtml&amp;quot;&lt;/span&gt;,&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                                                 &lt;span class=&quot;str&quot;&gt;&amp;quot;~/Views/Shared/DisplayTemplates/{1}/{0}.vbhtml&amp;quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;&amp;#160;&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                                             };&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;        }&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;&amp;#160;&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;        &lt;span class=&quot;kwrd&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;override&lt;/span&gt; IView CreatePartialView(ControllerContext controllerContext, &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; partialPath)&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;        {&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;            var areaName = &lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.GetAreaFromNameSpace(controllerContext);&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;            &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;base&lt;/span&gt;.CreatePartialView(controllerContext, partialPath.Replace(&lt;span class=&quot;str&quot;&gt;&amp;quot;%1&amp;quot;&lt;/span&gt;, areaName));&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;        }&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;&amp;#160;&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;        &lt;span class=&quot;kwrd&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;override&lt;/span&gt; IView CreateView(ControllerContext controllerContext, &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; viewPath, &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; masterPath)&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;        {&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;            var areaName = &lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.GetAreaFromNameSpace(controllerContext);&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;            &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;base&lt;/span&gt;.CreateView(controllerContext, viewPath.Replace(&lt;span class=&quot;str&quot;&gt;&amp;quot;%1&amp;quot;&lt;/span&gt;, areaName), masterPath.Replace(&lt;span class=&quot;str&quot;&gt;&amp;quot;%1&amp;quot;&lt;/span&gt;, areaName));&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;        }&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;&amp;#160;&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;        &lt;span class=&quot;kwrd&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;override&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;bool&lt;/span&gt; FileExists(ControllerContext controllerContext, &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; virtualPath)&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;        {&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;            var areaName = &lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.GetAreaFromNameSpace(controllerContext);&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;&amp;#160;&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;            &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (!&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;.IsNullOrEmpty(areaName))&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;            {&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;base&lt;/span&gt;.FileExists(controllerContext, virtualPath.Replace(&lt;span class=&quot;str&quot;&gt;&amp;quot;%1&amp;quot;&lt;/span&gt;, areaName));&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;            }&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;&amp;#160;&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;            &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;base&lt;/span&gt;.FileExists(controllerContext, virtualPath);&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;        }&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;&amp;#160;&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;        &lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; GetAreaFromNameSpace(ControllerContext controllerContext)&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;        {&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;            &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (controllerContext.Controller != &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;)&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;            {&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                var nameSpace = controllerContext.Controller.GetType().Namespace ?? &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;.Empty;&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                var namespaceSegments = nameSpace.Split(&lt;span class=&quot;str&quot;&gt;&#39;.&#39;&lt;/span&gt;);&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (namespaceSegments.Length &amp;gt;= 2)&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                {&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                    &lt;span class=&quot;kwrd&quot;&gt;for&lt;/span&gt; (var i =0; i &amp;lt; namespaceSegments.Length; i++)&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                    {&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                        &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; ((namespaceSegments[i] == &lt;span class=&quot;str&quot;&gt;&amp;quot;Controllers&amp;quot;&lt;/span&gt;) &amp;amp;&amp;amp; i &amp;gt; 0)&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                        {&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                            &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; namespaceSegments[i-1];&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                        }&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                    }&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;                }&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;            }&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;&amp;#160;&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;            &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;;&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;        }&lt;/code&gt;&lt;/pre&gt;

  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;    }&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;style type=&quot;text/css&quot;&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, &quot;Courier New&quot;, courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;br clear=&quot;all&quot; /&gt;

&lt;br clear=&quot;all&quot; /&gt;



&lt;br clear=&quot;all&quot; /&gt;

&lt;p&gt;You then need to register this view engine on initialize module , as below: 
  &lt;br clear=&quot;all&quot; /&gt;

  &lt;br clear=&quot;all&quot; /&gt;&lt;/p&gt;

&lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;&lt;pre style=&quot;font-size: 12px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; width: 100%; margin: 0em; background-color: #ffffff&quot;&gt;[ModuleDependency(&lt;span style=&quot;color: #0000ff&quot;&gt;typeof&lt;/span&gt; (InitializationModule))]
&lt;/pre&gt;&lt;pre style=&quot;font-size: 12px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; width: 100%; margin: 0em; background-color: #ffffff&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;class&lt;/span&gt; CustomizedRenderingInitialization : IInitializableModule
&lt;/pre&gt;&lt;pre style=&quot;font-size: 12px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; width: 100%; margin: 0em; background-color: #ffffff&quot;&gt;    {
&lt;/pre&gt;&lt;pre style=&quot;font-size: 12px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; width: 100%; margin: 0em; background-color: #ffffff&quot;&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;void&lt;/span&gt; Initialize(InitializationEngine context)
&lt;/pre&gt;&lt;pre style=&quot;font-size: 12px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; width: 100%; margin: 0em; background-color: #ffffff&quot;&gt;        {            
&lt;/pre&gt;&lt;pre style=&quot;font-size: 12px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; width: 100%; margin: 0em; background-color: #ffffff&quot;&gt;            ViewEngines.Engines.Insert(0, &lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; NitecoViewEngine());          
&lt;/pre&gt;&lt;pre style=&quot;font-size: 12px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; width: 100%; margin: 0em; background-color: #ffffff&quot;&gt;        }
&lt;/pre&gt;&lt;pre style=&quot;font-size: 12px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; width: 100%; margin: 0em; background-color: #ffffff&quot;&gt;    }
&lt;/pre&gt;&lt;pre style=&quot;font-size: 12px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; width: 100%; margin: 0em; background-color: #ffffff&quot;&gt;}&lt;/pre&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Now you could add any part of the project that you want to separate from the other areas, like how we did we our EPiServer Commerce Project as above.Just need to make sure that you keep the correct consistent naming for all the namespaces within the areas. This works for both EPiServer 7 &amp;amp; EPiServer 7.5 as we have examined.&lt;/p&gt;

&lt;p&gt;Happy coding , stay tune for the next part.&lt;/p&gt;</description>            <guid>https://world.optimizely.com/blogs/Tuan--Truong/Dates/2014/2/Upgrade-to-EPiServer-Commerce-75--Part-2-MVC-Areas-Support-For-EPiServer-7--above/</guid>            <pubDate>Thu, 20 Feb 2014 05:30:38 GMT</pubDate>           <category>Blog post</category></item><item> <title>Upgrade to EPiServer Commerce 7.5 : Part 1– Allow users to drag and drop catalog node and catalog variant on to content areas.</title>            <link>https://world.optimizely.com/blogs/Tuan--Truong/Dates/2014/2/Upgrade-to-EPiServer-Commerce-75--Part-1---Drag-and-drop-catalog-node-and-catalog-variant-on-to-content-areas/</link>            <description>&lt;div id=&quot;scid:0767317B-992E-4b12-91E0-4F059A8CECA8:cb061a40-1c17-429f-920b-3bdbbbf3ec25&quot; class=&quot;wlWriterEditableSmartContent&quot; style=&quot;float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px&quot;&gt;Technorati Tags: &lt;a href=&quot;http://technorati.com/tags/EPiServer+7.5&quot; rel=&quot;tag&quot;&gt;EPiServer 7.5&lt;/a&gt;,&lt;a href=&quot;http://technorati.com/tags/Commerce&quot; rel=&quot;tag&quot;&gt;Commerce&lt;/a&gt;,&lt;a href=&quot;http://technorati.com/tags/Asp.net+MVC&quot; rel=&quot;tag&quot;&gt;Asp.net MVC&lt;/a&gt;&lt;/div&gt;  &lt;p&gt;In our company, we are always given the chances to work with latest and up to date technologies, and EPiServer 7.5 Commerce was one of the cool stuff that my team had the opportunity to explore so far. Kudos to EPiServer team to help me create this blog, on this space.&amp;#160; I will try to share all our experiences on upgrading one of our client EPiServer Commerce site from EPiServer 6 R2 on to EPiServer 7.5 , getting used of latest technology on EPiServer 7.5, Asp.net MVC4, html5/css3 .    &lt;br clear=&quot;all&quot; /&gt;    &lt;br clear=&quot;all&quot; /&gt;Would love to hear any feedback and comments that you guys may have, all for the better community and better product for us all &lt;img class=&quot;wlEmoticon wlEmoticon-smile&quot; style=&quot;border-top-style: none; border-bottom-style: none; border-right-style: none; border-left-style: none&quot; alt=&quot;Smile&quot; src=&quot;/link/2f7af758255742f1960065a62d266291.png&quot; /&gt;.     &lt;br clear=&quot;all&quot; /&gt;    &lt;br clear=&quot;all&quot; /&gt;On this first blog post, I will describe how we managed to allow user to drag and drop any catalog node and catalog content on to the content areas of the page from the catalog manager component. This is just like how you can drop pages on to different content areas.&amp;#160; &lt;br clear=&quot;all&quot; /&gt;Firstly, we will need a base controller for all our partial content :     &lt;br clear=&quot;all&quot; /&gt;    &lt;br clear=&quot;all&quot; /&gt;&lt;/p&gt;  &lt;br clear=&quot;all&quot; /&gt;  &lt;pre&gt;&lt;pre style=&quot;font-size: 12px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; width: 100%; margin: 0em; background-color: #ffffff&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;namespace&lt;/span&gt; Niteco.Web.Cms.Controllers 
&lt;/pre&gt;&lt;pre style=&quot;font-size: 12px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; width: 100%; margin: 0em; background-color: #ffffff&quot;&gt;{ 
&lt;/pre&gt;&lt;pre style=&quot;font-size: 12px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; width: 100%; margin: 0em; background-color: #ffffff&quot;&gt;    [TemplateDescriptor(TemplateTypeCategory = TemplateTypeCategories.MvcPartialController, Inherited = &lt;span style=&quot;color: #0000ff&quot;&gt;true&lt;/span&gt;,AvailableWithoutTag = &lt;span style=&quot;color: #0000ff&quot;&gt;false&lt;/span&gt;)] 
&lt;/pre&gt;&lt;pre style=&quot;font-size: 12px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; width: 100%; margin: 0em; background-color: #ffffff&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;class&lt;/span&gt; BasePartialContentController&amp;lt;T&amp;gt; : PartialContentController&amp;lt;T&amp;gt; where T : IContentData 
&lt;/pre&gt;&lt;pre style=&quot;font-size: 12px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; width: 100%; margin: 0em; background-color: #ffffff&quot;&gt;    { 
&lt;/pre&gt;&lt;pre style=&quot;font-size: 12px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; width: 100%; margin: 0em; background-color: #ffffff&quot;&gt;    } 
&lt;/pre&gt;&lt;pre style=&quot;font-size: 12px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; width: 100%; margin: 0em; background-color: #ffffff&quot;&gt;}&lt;/pre&gt;&lt;/pre&gt;

&lt;br clear=&quot;all&quot; /&gt;

&lt;p&gt;In EPiServer 7.5, there is a base partial content controller to help deliver all partial contents to the pages. 
  &lt;br clear=&quot;all&quot; /&gt;Then for each catalog node content that you want to allow to be dropped on to content area, just need to have it inherit from above base controller: 

  &lt;br clear=&quot;all&quot; /&gt;&lt;/p&gt;

&lt;pre&gt;&lt;pre style=&quot;font-size: 12px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; width: 100%; margin: 0em; background-color: #ffffff&quot;&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;class&lt;/span&gt; WineCatalogPartialController : BasePartialContentController&amp;lt;WineCatalogNodeContent&amp;gt;
&lt;/pre&gt;&lt;pre style=&quot;font-size: 12px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; width: 100%; margin: 0em; background-color: #ffffff&quot;&gt;    {
&lt;/pre&gt;&lt;pre style=&quot;font-size: 12px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; width: 100%; margin: 0em; background-color: #ffffff&quot;&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;override&lt;/span&gt; ActionResult Index(WineCatalogNodeContent currentContent)
&lt;/pre&gt;&lt;pre style=&quot;font-size: 12px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; width: 100%; margin: 0em; background-color: #ffffff&quot;&gt;        {
&lt;/pre&gt;&lt;pre style=&quot;font-size: 12px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; width: 100%; margin: 0em; background-color: #ffffff&quot;&gt;            var model =  CatalogNodeViewModelHelpers.BuidWineItemListingModel(currentContent);
&lt;/pre&gt;&lt;pre style=&quot;font-size: 12px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; width: 100%; margin: 0em; background-color: #ffffff&quot;&gt;            &lt;span style=&quot;color: #0000ff&quot;&gt;return&lt;/span&gt; PartialView(&amp;quot;&lt;span style=&quot;color: #8b0000&quot;&gt;WineItemListingView&lt;/span&gt;&amp;quot;, model);
&lt;/pre&gt;&lt;pre style=&quot;font-size: 12px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; width: 100%; margin: 0em; background-color: #ffffff&quot;&gt;        }
&lt;/pre&gt;&lt;pre style=&quot;font-size: 12px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; width: 100%; margin: 0em; background-color: #ffffff&quot;&gt;    }&lt;/pre&gt;&lt;/pre&gt;

&lt;div align=&quot;left&quot;&gt;
  &lt;blockquote&gt;&amp;#160;&lt;/blockquote&gt;
&lt;/div&gt;

&lt;div align=&quot;left&quot;&gt;
  &lt;p&gt;In our model builder function, we basically get all the catalog entries within this catalog node, .i.e:&lt;/p&gt;
&lt;/div&gt;



&lt;pre&gt;&lt;pre style=&quot;font-size: 12px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; width: 100%; margin: 0em; background-color: #ffffff&quot;&gt;var entries = wineItemSearchHelper.SearchEntries(catNodeContent.Code, 0, Int32.MaxValue,&lt;span style=&quot;color: #0000ff&quot;&gt;out&lt;/span&gt; totalCount);&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;The same apply for product variant content when you want to drag drop it to the content area of the page, you will need to inherit from the base partial content controller: 
  &lt;br clear=&quot;all&quot; /&gt;

  &lt;br clear=&quot;all&quot; /&gt;&lt;/p&gt;

&lt;br clear=&quot;all&quot; /&gt;

&lt;pre&gt;&lt;pre style=&quot;font-size: 12px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; width: 100%; margin: 0em; background-color: #ffffff&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;class&lt;/span&gt; WineItemPartialController : BasePartialContentController&amp;lt;WineItemContent&amp;gt;
&lt;/pre&gt;&lt;pre style=&quot;font-size: 12px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; width: 100%; margin: 0em; background-color: #ffffff&quot;&gt;    {
&lt;/pre&gt;&lt;pre style=&quot;font-size: 12px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; width: 100%; margin: 0em; background-color: #ffffff&quot;&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;override&lt;/span&gt; ActionResult Index(WineItemContent currentContent)
&lt;/pre&gt;&lt;pre style=&quot;font-size: 12px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; width: 100%; margin: 0em; background-color: #ffffff&quot;&gt;        {
&lt;/pre&gt;&lt;pre style=&quot;font-size: 12px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; width: 100%; margin: 0em; background-color: #ffffff&quot;&gt;            var model = &lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; WineItemPartialViewModel(currentContent)
&lt;/pre&gt;&lt;pre style=&quot;font-size: 12px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; width: 100%; margin: 0em; background-color: #ffffff&quot;&gt;            {
&lt;/pre&gt;&lt;pre style=&quot;font-size: 12px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; width: 100%; margin: 0em; background-color: #ffffff&quot;&gt;                WineItemDetails = WineItemViewModelHelpers.CreateWineItemContentViewModel(currentContent)
&lt;/pre&gt;&lt;pre style=&quot;font-size: 12px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; width: 100%; margin: 0em; background-color: #ffffff&quot;&gt;            };
&lt;/pre&gt;&lt;pre style=&quot;font-size: 12px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; width: 100%; margin: 0em; background-color: #ffffff&quot;&gt;            &lt;span style=&quot;color: #0000ff&quot;&gt;return&lt;/span&gt; PartialView(&amp;quot;&lt;span style=&quot;color: #8b0000&quot;&gt;VariantPartials/WineItemFullPartialView&lt;/span&gt;&amp;quot;, model);
&lt;/pre&gt;&lt;pre style=&quot;font-size: 12px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; width: 100%; margin: 0em; background-color: #ffffff&quot;&gt;        }
&lt;/pre&gt;&lt;/pre&gt;

&lt;hr /&gt;

&lt;p&gt;There was one big issue when we were implementing this was that it causing the site to “stack overflow”, and after many hours of digging, we have found the cause. It was because of the following bit of code in our partial view: 
  &lt;br clear=&quot;all&quot; /&gt;

  &lt;br clear=&quot;all&quot; /&gt;&lt;/p&gt;

&lt;pre&gt;&lt;pre style=&quot;font-size: 12px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; width: 100%; margin: 0em; background-color: #ffffff&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;div&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;class&lt;/span&gt;=&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;quot;product_selling_info&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style=&quot;font-size: 12px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; width: 100%; margin: 0em; background-color: #ffffff&quot;&gt;    @Html.Action(&amp;quot;Index&amp;quot;, &amp;quot;AddToCart&amp;quot;, new { reference = Model.CatalogContent.ContentLink})
&lt;/pre&gt;&lt;pre style=&quot;font-size: 12px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; width: 100%; margin: 0em; background-color: #ffffff&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;div&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;Somehow, it is causing the page to keep recall the action within the page, we had to change the page to the following , :&lt;/p&gt;

&lt;pre&gt;&lt;pre style=&quot;font-size: 12px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; width: 100%; margin: 0em; background-color: #ffffff&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;div&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;class&lt;/span&gt;=&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;quot;product_selling_info&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style=&quot;font-size: 12px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; width: 100%; margin: 0em; background-color: #ffffff&quot;&gt;     @Html.Action(&amp;quot;Index&amp;quot;, &amp;quot;AddToCart&amp;quot;, new { reference = Model.CatalogContent.ContentLink, controllerType = typeof(AddToCartController).AssemblyQualifiedName })
&lt;/pre&gt;&lt;pre style=&quot;font-size: 12px; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; width: 100%; margin: 0em; background-color: #ffffff&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;div&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;This is for the page to understand that the action is belong to another controller, not the current page controller. 
  &lt;br clear=&quot;all&quot; /&gt;&lt;/p&gt;

&lt;p&gt;That is all. Hopefully this will help you guys in implementing the drag drop catalog contents on the the content area. In the next coming posts, I will continue to provide more knowledge sharing our process to upgrade an ecommerce site to EPiServer 7.5. If you need the detailed source code or any help, please leave a comment below. 
  &lt;br clear=&quot;all&quot; /&gt;

  &lt;br clear=&quot;all&quot; /&gt;Thanks.&lt;/p&gt;</description>            <guid>https://world.optimizely.com/blogs/Tuan--Truong/Dates/2014/2/Upgrade-to-EPiServer-Commerce-75--Part-1---Drag-and-drop-catalog-node-and-catalog-variant-on-to-content-areas/</guid>            <pubDate>Mon, 17 Feb 2014 05:09:41 GMT</pubDate>           <category>Blog post</category></item></channel>
</rss>