<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom"><title type="text">Blog posts by Sergey Vorushilo</title><link href="http://world.optimizely.com" /><updated>2019-10-29T20:08:20.0000000Z</updated><id>https://world.optimizely.com/blogs/Sergey-Vorushilo/</id> <generator uri="http://world.optimizely.com" version="2.0">Optimizely World</generator> <entry><title>Getting started with deployment API in DXC</title><link href="https://world.optimizely.com/blogs/Sergey-Vorushilo/Dates/2019/10/deployment-api-in-dxc/" /><id>&lt;p&gt;&lt;span&gt;We just have released&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;/link/cecd04dddeea47f89a14d7f163913728.aspx&quot;&gt;&lt;span&gt;Deployment API&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&amp;nbsp;in DXC-S as an Open&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;/link/b65125e7212142059e425ee2d086c652.aspx&quot;&gt;&lt;span&gt;Beta&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&amp;nbsp;program. This feature allows partners and customers to automate deployment to DXC environments via API.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;There are two ways to deploy code changes via API:&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span&gt;Using a source environment - this is a traditional way to push changes in DXC. The application code is deployed to the Integration environment using any preferred tool supported by Azure Web Apps, and then get promoted to the Preproduction environment, and after that to the Production environment. The deployment flow is sequential.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Using code packages - this is a new method. It requires to&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;/link/03b842974cad4e589239047cedd4a963.aspx&quot;&gt;&lt;span&gt;package&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&amp;nbsp;your application code as a NuGet package first, and then it can be deployed to any environment. The deployment flow is much more flexible, but with great powers comes great responsibility, so we highly recommend to deploy your package to any non-production environment first before deploying it to Production.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;span&gt;It is possible to mix both ways, but it worth mentioning that we see the code packages as a primary way of doing deployments in the future.&lt;/span&gt;&lt;/p&gt;
&lt;h2&gt;&lt;span&gt;How do I get started?&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span&gt;First, you will need to get Deployment API credentials. You can&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;/link/858d3e9c8a7a41c7afab709a3e0558a4.aspx&quot;&gt;&lt;span&gt;generate&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&amp;nbsp;it using the DXC-S Management portal. The API credentials are specific per target environment. So if you are planning to deploy from Integration to Preproduction environment, you need to provide API credentials for Preproduction.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Next, install&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;https://www.powershellgallery.com/packages/EpiCloud&quot;&gt;&lt;span&gt;EpiCloud&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&amp;nbsp;PowerShell module.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Now we are ready to start our first deployment via API. Let&#39;s deploy a CMS site from Integration to Preproduction. Open a PowerShell prompt and use the commands listed below.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;The Import-Module command makes EpiCloud cmdlets available in the current PowerShell prompt:&lt;/p&gt;
&lt;pre class=&quot;language-markup&quot;&gt;&lt;code&gt;Import-Module EPiCloud&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The Connect-EpiCloud command stores API credentials in the console session, so we don&#39;t need to specify it again with every command:&lt;/p&gt;
&lt;pre class=&quot;language-markup&quot;&gt;&lt;code&gt;Connect-EpiCloud -ClientKey &amp;lt;...&amp;gt; -ClientSecret &amp;lt;...&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And the Start-EpiDeployment will kick-off a deployment process:&lt;/p&gt;
&lt;pre class=&quot;language-markup&quot;&gt;&lt;code&gt;Start-EpiDeployment -ProjectId ae874a90-08de-4a03-a865-aaf500f4830e -SourceApp cms -SourceEnvironment Integration -TargetEnvironment Preproduction&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The command will respond with the current deployment status and deployment id:&lt;/p&gt;
&lt;pre class=&quot;language-markup&quot;&gt;&lt;code&gt;id                 : 5eec46c4-df99-47e6-a6b9-aaf5010874f8
projectId          : ae874a90-08de-4a03-a865-aaf500f4830e
status             : InProgress
startTime          : 2019-10-29T16:00:51.123Z
endTime            :
percentComplete    : 0
validationLinks    : {}
deploymentWarnings : {}
deploymentErrors   : {}
parameters         : @{targetEnvironment=Preproduction; sourceEnvironment=Integration; sourceApps=System.Object[]; maintenancePage=False; includeBlob=False; includeDb=False}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The deployment id is needed to get the deployment status and to complete or reset the deployment. In order to get the deployment status use&amp;nbsp;Get-EpiDeployment command:&lt;/p&gt;
&lt;pre class=&quot;language-markup&quot;&gt;&lt;code&gt;Get-EpiDeployment -ProjectId ae874a90-08de-4a03-a865-aaf500f4830e -Id 5eec46c4-df99-47e6-a6b9-aaf5010874f8&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Once the first stage of the deployment is finished, we can validate the site on the deployment slot. The URL to the slot&amp;nbsp;can be found in the validationLinks property in the Get-Deployment command response:&lt;/p&gt;
&lt;pre class=&quot;language-markup&quot;&gt;&lt;code&gt;id                 : 5eec46c4-df99-47e6-a6b9-aaf5010874f8
projectId          : ae874a90-08de-4a03-a865-aaf500f4830e
status             : AwaitingVerification
startTime          : 2019-10-29T16:10:14.198Z
endTime            :
percentComplete    : 100
validationLinks    : {http://sevodeploy275uzuprep-slot.dxcloud.episerver.net/}
deploymentWarnings : {}
deploymentErrors   : {}
parameters         : @{targetEnvironment=Preproduction; sourceEnvironment=Integration; sourceApps=System.Object[]; maintenancePage=False; includeBlob=False; includeDb=False}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now we can either complete or reset the deployment. There are two corresponding commands for that:&lt;/p&gt;
&lt;pre class=&quot;language-markup&quot;&gt;&lt;code&gt;Complete-EpiDeployment -ProjectId ae874a90-08de-4a03-a865-aaf500f4830e -Id 5eec46c4-df99-47e6-a6b9-aaf5010874f8 &lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;or&lt;/p&gt;
&lt;pre class=&quot;language-markup&quot;&gt;&lt;code&gt;Reset-EpiDeployment -ProjectId ae874a90-08de-4a03-a865-aaf500f4830e -Id 5eec46c4-df99-47e6-a6b9-aaf5010874f8&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;After running the Complete-EpiDeployment command we get the deployment status displayed:&lt;/p&gt;
&lt;pre class=&quot;language-markup&quot;&gt;&lt;code&gt;id                 : 5eec46c4-df99-47e6-a6b9-aaf5010874f8
projectId          : ae874a90-08de-4a03-a865-aaf500f4830e
status             : Completing
startTime          : 2019-10-29T16:20:51.123Z
endTime            :
percentComplete    : 0
validationLinks    : {}
deploymentWarnings : {}
deploymentErrors   : {}
parameters         : @{targetEnvironment=Preproduction; sourceEnvironment=Integration; sourceApps=System.Object[]; maintenancePage=False; includeBlob=False; includeDb=False}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The Complete-EpiDeployment command swaps the slot and deployment is now completed!&lt;/p&gt;
&lt;p&gt;If you want to learn more, you can find a detailed description of all commands provided with the EpiCloud module in&amp;nbsp;&lt;a href=&quot;/link/eb85a23d0c1843aaa36f121668e1059e.aspx&quot;&gt;the documentation&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Using Azure DevOps? &lt;a href=&quot;/link/21aee4bc5c4d44518c1ed29c846185e2.aspx&quot;&gt;This blog post&lt;/a&gt; describes how to configure a continuous delivery pipeline with DXC-S.&lt;/p&gt;</id><updated>2019-10-29T20:08:20.0000000Z</updated><summary type="html">Blog post</summary></entry> <entry><title>Scheduled jobs setup in DXC Service</title><link href="https://world.optimizely.com/blogs/Sergey-Vorushilo/Dates/2017/12/scheduled-jobs-setup-in-dxc-service/" /><id>&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;p&gt;Scheduled jobs is one of the essential features of Episerver platform. The main purpose of scheduled jobs is to execute in background repeatable long-running tasks within Episerver context, but outside of a web request. You can find more information about this feature &lt;a href=&quot;/link/a93fdf30496042669df2edd7a960d94e.aspx&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;A long-running and resource-intensive scheduled job might negatively affect application performance when it runs on the same web server that also serves site visitors requests. There is a known solution for this - when the application is hosted on multiple web servers one of the web servers is dedicated to scheduled jobs by applying a configuration change (see Multi-sever scenario in the scheduled jobs &lt;a href=&quot;/link/a93fdf30496042669df2edd7a960d94e.aspx&quot;&gt;documentation&lt;/a&gt;) and exclude the server from the load balancers list. This setup works fine for the hosting scenarios when the site administrator has full access to the web servers. However, in case of multi-tenant hosting solution like Azure App Service, there is no way to control configuration for individual web server instances. Here is how we solve this in DXC Service.&lt;/p&gt;
&lt;p&gt;Since each web server instance in Azure App Service has identical application codebase and configuration, there is no way to configure the &lt;em&gt;enableScheduler&lt;/em&gt; attribute for a particular instance. Instead, we configure enableScheduler=&amp;rdquo;false&amp;rdquo; for the&amp;nbsp;whole WebApp that serves site visitor requests, and create a separate WebApp dedicated to scheduled jobs, that has the same codebase and configuration as the primary one, except &lt;em&gt;enableScheduler&lt;/em&gt; is set to &amp;rdquo;true.&amp;rdquo; To avoid any performance impact on the primary WebApp, the scheduled jobs WebApp is hosted on a separate App Service. Each App Service in Azure is essentially a set of web workers that can host one or multiple web applications (more in-depth information about this topic is available &lt;a href=&quot;https://msdn.microsoft.com/en-us/magazine/mt793270.aspx&quot;&gt;here&lt;/a&gt;). By using a separate App Service, we can ensure that scheduled jobs will run on dedicated web workers. The scheduled jobs WebApp and App Service is provisioned as needed in DXC Service and updated automatically by DXC deployment flow together with the primary WebApp, so this process is completely transparent for DXC customers and doesn&amp;rsquo;t require any code changes or configuration updates. The DXC deployment flow will also configure the enableScheduler attribute automatically. Note that dedicated scheduled jobs WebApp and App Service are created only on Pre-production and Production environments, but not on Integration.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/link/c4c82204e434425d9700ab06f24499d5.aspx&quot; alt=&quot;Image scheduler-deploy.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;When developing a scheduled job for a site hosted in DXC-S, it is important to define the job as stoppable - set the &lt;em&gt;IsStoppable&lt;/em&gt; property to true and implement the &lt;em&gt;Stop&lt;/em&gt; method. This will&amp;nbsp;give a chance for your job to perform a graceful shutdown when the web worker instance is recycled during jobs execution. Another important consideration, especially for the long-running jobs and jobs processing massive amounts of data, is to configure the job as &lt;em&gt;Restartable&lt;/em&gt;. This will tell the scheduler service to start the job again if the job was shut down during the previous execution. It&amp;rsquo;s up to the jobs implementation to store some checkpoint to be able to resume the processing when restarted.&amp;nbsp;&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</id><updated>2017-12-19T18:44:58.0000000Z</updated><summary type="html">Blog post</summary></entry> <entry><title>Find optimizations export-import</title><link href="https://world.optimizely.com/blogs/Sergey-Vorushilo/Dates/2015/11/find-optimizations-export--import/" /><id>&lt;p&gt;Recently I got a question if there is a way to transfer EPiServer Find optimizations from one index to another. By optimizations here I mean synonyms, related queries, autocomplete entries and best bets. There was no utility for this, so my suggestion was to use the same REST API that we use in EPiServer Find UI. Using this REST API without documentation and ability to look under the hood might be quite challenging, so I decided to write a tool for this myself.&lt;/p&gt;
&lt;p&gt;The tool is an EPiServer Admin mode plugin that allows exporting and importing EPiServer Find optimizations entities between indexes or sites. It is packed as a NuGet package and uses JSON format for export. It is available at &lt;a href=&quot;http://nuget.episerver.com/en/OtherPages/Package/?packageId=Vro.FindExportImport&quot;&gt;nuget.episerver.com&lt;/a&gt;, so you can install it by running &lt;strong&gt;Install-Package Vro.FindExportImport&lt;/strong&gt; in Visual Studio package manager console. Once installed the plugin can be found in Admin mode under the Tools section.&lt;/p&gt;
&lt;p&gt;Exporting and importing Find optimizations has two synchronization problems: how to match sites (each optimization belong to an individual site or &quot;All sites&quot;) and how to match the content selected in Best bets.&lt;/p&gt;
&lt;p&gt;When it comes to sites, it is relatively easy: optimizations can be exported only within a single site. &lt;br /&gt;&lt;img src=&quot;/link/aaac9a82c415420bb983f03dd0a3c4a9.aspx&quot; alt=&quot;Image ExportView.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;When importing, users select a target site and all optimizations just get new site value during import.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/link/6ebea052ce494dc2b68a9cce4ee19918.aspx&quot; alt=&quot;Image ImportView.png&quot; /&gt;&lt;br /&gt;Please note, the value &amp;ldquo;All sites&amp;rdquo; in EPiServer Find does not mean all available sites, but rather a unique value indicating that an optimization has an effect on all sites. Therefore, when exporting with &amp;ldquo;All sites&amp;rdquo; selected, it just means only optimizations with &amp;ldquo;All sites&amp;rdquo; value are exported and not optimizations from all sites. The same is for import: all imported entities assigned to the selected site or the special &amp;ldquo;All sites&amp;rdquo; value. The plugin also can be used to copy optimizations from one site to another within the same index.&lt;/p&gt;
&lt;p&gt;For the content references in best bets, I have not found a better solution than just trying to find a matching content by name on the target site. For best bets with pages, importer searches within pages, and for best bets with commerce products, importer searches only within commerce catalog items. If there is no content with a matching name, the best bet is skipped from importing.&lt;/p&gt;
&lt;p&gt;When importing optimizations, the same validation rules apply as if optimization is created manually in EPiServer Find UI. If there is already an optimization with the same properties like the one being imported, no new optimization is created, and no existing optimizations get updated.&lt;/p&gt;
&lt;p&gt;Plugins source code is available at&amp;nbsp;&lt;a href=&quot;https://github.com/SergVro/FindExportImport&quot;&gt;GitHub&lt;/a&gt;&lt;/p&gt;</id><updated>2015-11-13T20:29:24.3370000Z</updated><summary type="html">Blog post</summary></entry> <entry><title>Customized Search Block in EPiServer Find</title><link href="https://world.optimizely.com/blogs/Sergey-Vorushilo/Dates/2015/7/customized-search-block-in-episerver-find/" /><id>&lt;p&gt;In the &lt;a href=&quot;/link/ce684597de2c4982b118f64748818a55.aspx&quot;&gt;latest version&lt;/a&gt; of EPiServer Find, we have added a new feature for editors. It’s &lt;a href=&quot;/link/76974ad8d2a84c1b989ad0ac453ab663.aspx?epsremainingpath=ReleaseNote/&amp;amp;releaseNoteId=109403&quot;&gt;Customized Search Block&lt;/a&gt;. This feature provides editors with a block that shows a dynamic list of links to the content matching a search criteria. Search for the content is based on EPiServer Find&#39;s powerful capabilities. This block can be used, for example, to display&amp;nbsp;related content such as “you may also like” links etc.&lt;/p&gt;
&lt;h1&gt;Settings&lt;/h1&gt;
&lt;p&gt;The block settings let editors choose how to display the list as well as fine tune the search query.&lt;/p&gt;
&lt;p&gt;Basic block settings in On-Page editing mode:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/link/1fd4ecb57cc64e5082d9cf18f3f95343.aspx&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;/link/027711e216154ab898adf89d3b157cba.aspx&quot; height=&quot;512&quot; width=&quot;792&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;All settings for the block available in the All Properties mode:&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;&quot; src=&quot;/link/aa02896b427a47c69c2119b5dc169513.aspx&quot; height=&quot;587&quot; width=&quot;809&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Details about each parameter can be found in the &lt;a href=&quot;/link/76974ad8d2a84c1b989ad0ac453ab663.aspx?epsremainingpath=ReleaseNote/&amp;amp;releaseNoteId=109403&quot;&gt;documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h1&gt;Customization&lt;/h1&gt;
&lt;p&gt;You can adjust the block&#39;s appearance by adding CSS classes described in the&amp;nbsp;&lt;a href=&quot;/link/7a6fae5524094d8fa96d7e5f701a70cd.aspx&quot;&gt;styling guide&lt;/a&gt; for developers. What if we want to customize a block&#39;s rendering? There are several ways to do it, but first let’s take a look on how the block is built. Here is a class diagram for content types:&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;&quot; src=&quot;/link/3b3ef7aab0994d1eb5abdf15e0043186.aspx&quot; height=&quot;384&quot; width=&quot;523&quot; /&gt;&lt;/p&gt;
&lt;p&gt;CustomizedSearchBlock has three properties and two of them are also blocks: CustomizedSearchSettings and CustomizedSearchAdvancedSettings. The last two blocks can’t be instantiated by editors and are used only to group the settings. Such grouping lets you use On-Page editing for basic settings and provides visual controls grouping in All properties mode.&lt;/p&gt;
&lt;p&gt;All logic for creating a query to EPiServer Find is placed in EPiServer.Find.Blocks.ICustomizedSearchBlockService implementation. It has two methods:&lt;/p&gt;
&lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;overflow: auto; cursor: text; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 97.5%; direction: ltr; text-align: left; margin: 20px 0px 10px; line-height: 12pt; max-height: 400px; background-color: #f4f4f4; border: silver 1px solid; padding: 4px;&quot;&gt;
&lt;pre id=&quot;codeSnippet&quot; style=&quot;overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; background-color: #f4f4f4; border-style: none; padding: 0px;&quot;&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;interface&lt;/span&gt; ICustomizedSearchBlockService&lt;br /&gt;{&lt;br /&gt;    ITypeSearch&amp;lt;ISearchContent&amp;gt; CreateSearchQuery(CustomizedSearchBlock currentBlock);&lt;br /&gt;    CustomizedSearchResultsViewModel CreateViewModel(UnifiedSearchResults results, &lt;span style=&quot;color: #0000ff;&quot;&gt;bool&lt;/span&gt; includeDescription);&lt;br /&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;div id=&quot;codeSnippetWrapper&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;p&gt;CreateSearchQuery method accepts CustomizedSearchBlock instance as an argument and returns ITypeSearch. The returned value is an EPiServer Find search request prepared with a query and filters according to the blocks settings and ready to call GetResult on it. CreateViewModel method takes UnifiedSearchResults and returns a view model for the block:&lt;/p&gt;
&lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;overflow: auto; cursor: text; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 97.5%; direction: ltr; text-align: left; margin: 20px 0px 10px; line-height: 12pt; max-height: 400px; background-color: #f4f4f4; border: silver 1px solid; padding: 4px;&quot;&gt;
&lt;pre id=&quot;codeSnippet&quot; style=&quot;overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; background-color: #f4f4f4; border-style: none; padding: 0px;&quot;&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;namespace&lt;/span&gt; EPiServer.Find.Blocks.Models&lt;br /&gt;{&lt;br /&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; CustomizedSearchResultsViewModel&lt;br /&gt;    {&lt;br /&gt;        &lt;span style=&quot;color: #0000ff;&quot;&gt;public&lt;/span&gt; IList&amp;lt;SearchListItem&amp;gt; Items { get; set; }&lt;br /&gt;        &lt;span style=&quot;color: #0000ff;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;bool&lt;/span&gt; IncludeDescription { get; set; }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&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; SearchListItem&lt;br /&gt;    {&lt;br /&gt;        &lt;span style=&quot;color: #0000ff;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;string&lt;/span&gt; Title { get; set; }&lt;br /&gt;        &lt;span style=&quot;color: #0000ff;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;string&lt;/span&gt; Url { get; set; }&lt;br /&gt;        &lt;span style=&quot;color: #0000ff;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;string&lt;/span&gt; Description { get; set; }&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;h1&gt;Creating a new renderer&lt;/h1&gt;
&lt;p&gt;The easiest way to provide a new rendering for the block is to create a new MVC Controller and a View. Because of implementation specificity, the new Controller should inherit from EPiServer.Find.Blocks.Controllers.CustomizedSearchSettingsBlockController&lt;i&gt;:&lt;/i&gt;&lt;/p&gt;
&lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;overflow: auto; cursor: text; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 97.5%; direction: ltr; text-align: left; margin: 20px 0px 10px; line-height: 12pt; max-height: 400px; background-color: #f4f4f4; border: silver 1px solid; padding: 4px;&quot;&gt;
&lt;pre id=&quot;codeSnippet&quot; style=&quot;overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; background-color: #f4f4f4; border-style: none; padding: 0px;&quot;&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;using&lt;/span&gt; System.Web.Mvc;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;using&lt;/span&gt; EPiServer.Find.Blocks;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;using&lt;/span&gt; EPiServer.Find.Blocks.Controllers;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;using&lt;/span&gt; EPiServer.Find.Blocks.Models.ContentTypes;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;namespace&lt;/span&gt; CustomizedSearchBlock.Controllers&lt;br /&gt;{&lt;br /&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; CustomRenderingSearchBlock : CustomizedSearchSettingsBlockController&lt;br /&gt;    {&lt;br /&gt;        &lt;span style=&quot;color: #0000ff;&quot;&gt;public&lt;/span&gt; CustomRenderingSearchBlock(ICustomizedSearchBlockService customizedSearchBlockService, IContextHelper contextHelper) &lt;br /&gt;            : &lt;span style=&quot;color: #0000ff;&quot;&gt;base&lt;/span&gt;(customizedSearchBlockService, contextHelper){}&lt;br /&gt;&lt;br /&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(CustomizedSearchSettings currentBlock)&lt;br /&gt;        {&lt;br /&gt;            var model = CreateSearchResultsViewModel(currentBlock);&lt;br /&gt;            &lt;span style=&quot;color: #0000ff;&quot;&gt;return&lt;/span&gt; PartialView(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;Index&quot;&lt;/span&gt;, model);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;div id=&quot;codeSnippetWrapper&quot; class=&quot;csharpcode-wrapper&quot;&gt;
&lt;p&gt;This controller is responsible for rendering the actual list. The list&#39;s heading is rendered by the parent blocks controller.&lt;/p&gt;
&lt;p&gt;Then,&amp;nbsp;you need to add a view:&lt;/p&gt;
&lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;overflow: auto; cursor: text; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 97.5%; direction: ltr; text-align: left; margin: 20px 0px 10px; line-height: 12pt; max-height: 200px; background-color: #f4f4f4; border: silver 1px solid; padding: 4px;&quot;&gt;
&lt;pre id=&quot;codeSnippet&quot; style=&quot;overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; background-color: #f4f4f4; border-style: none; padding: 0px;&quot;&gt;@model EPiServer.Find.Blocks.Models.CustomizedSearchResultsViewModel&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;dl&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    @foreach (var link in Model.Items)&lt;br /&gt;    {&lt;br /&gt;        &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;dd&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;            &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;a&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;href&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;@link.Url&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;@link.Title&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;a&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;dd&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    }&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;dl&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div class=&quot;csharpcode-wrapper&quot;&gt;The last step is to set the new controller as a default display template for the CustomizedSearchSettings block in Admin mode. To find the block in Admin mode,&amp;nbsp;you need to open settings for the Customized search block type first and click&amp;nbsp;the &lt;strong&gt;CustomizedSearchSettings&lt;/strong&gt; link in the Type column:&lt;/div&gt;
&lt;p&gt;&lt;img alt=&quot;&quot; src=&quot;/link/389812a5e4cd4fd28f3e390e085cc9e6.aspx&quot; height=&quot;405&quot; width=&quot;853&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In the settings view for the CustomizedSearchSettings block, click the &lt;strong&gt;Settings&lt;/strong&gt; button and choose the new controller in the MVC Template drop down. Now, the new renderer should be used when the block is displayed.&lt;/p&gt;
&lt;p&gt;If the data provided in the CustomizedSearchResultsViewModel is not enough, for example if we want to render an image together with a link, you can access search results directly using the ICustomizedSearchBlockService and creating your own view model. There is an example of such implementation on &lt;a href=&quot;https://github.com/SergVro/CustomizedSearchBlockSamples&quot;&gt;GitHub&lt;/a&gt; as well as the code for examples above.&lt;/p&gt;
&lt;/div&gt;</id><updated>2015-07-31T17:35:10.0000000Z</updated><summary type="html">Blog post</summary></entry> <entry><title>Command line support for Add-On system</title><link href="https://world.optimizely.com/blogs/Sergey-Vorushilo/Dates/2013/12/Command-line-support-for-Add-On-system/" /><id>&lt;p&gt;In the new version of EPiServer 7.5 we have added a new feature to the Add-On system – command line operations support. The web interface is still the primary way to manage add-ons on a site, but now there is an alternative that can be used if the web interface is not available. It is implemented as a PowerShell Snap-In that is installed together with the installation of EPiServer 7.5. The Snap-In contains the following CmdLets:&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Get-EPiAddOnConfiguration&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;This command returns technical details about the Add-On system configuration: public or protected modules locations, repositories folders etc.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Get-EPiAddOnFeeds&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Returns a list of configured add-on feeds. By default the Add-On system has three feeds configured (EPiServer Add-Ons, EPiServer Beta and Third-Party Add-Ons)&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Get-EPiAddOns&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Returns a list of add-ons installed on the site or a list of add-ons that can be installed from a specified feed&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Add-EPiAddOn&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Installs an add-on from a specified feed or from a file&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Remove-EPiAddOn&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Uninstalls an add-on from the site. &lt;/p&gt;  &lt;p&gt;&lt;b&gt;Update-EPiAddOn&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Updates an add-on on the site to specified version&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Enable-EPiAddOn&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Enables a previously disabled add-on on the site&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Disable-EPiAddOn&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Disables an add-on on the site. This is a new feature of EPiServer 7.5 – an add-on can be disabled, which means that it is not active and its code is not executed and its content is not available on the site, but it is still present in the list of installed add-ons, so user can easily enable it back, upgrade or delete and the add-ons data, if any, are preserved. Disabling might be particularly useful when solving issues related to add-ons compatibility. We also use it in the upgrade scenario.&lt;/p&gt;  &lt;p&gt;You can find detailed description of all CmdLets in the &lt;a href=&quot;http://world.episerver.com/Documentation/Items/Developers-Guide/EPiServer-Framework/75/Modules/Add-on-system-command-line-support/&quot;&gt;documentation&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;For developers these commands might be interesting for automation purposes or as tool for resolving issues related to add-ons. It might happen during development that an add-on installation make the site not accessible and there is no way to uninstall it from the sites web interface. Before there was not so many options, removing the add-on manually requires some knowledge of the Add-On system internals. Now there are two more options – disable or uninstall an add-on from the command line. &lt;/p&gt;  &lt;p&gt;In order to be able to use the commands “EPiServer.Install.Packaging” Snap-In need to be added to the session. Run PowerShell command line tool (if you have 64-bit operating system, please use 32-bit PowerShell, &lt;a href=&quot;http://technet.microsoft.com/en-us/library/hh847733.aspx&quot;&gt;here&lt;/a&gt; you can find how to do this) and type the following command:&lt;/p&gt;  &lt;pre&gt;Add-PSSnapin EPiServer.Install.Packaging.*&lt;/pre&gt;

&lt;p&gt;If nothing happened and you just returned back to the command prompt – it’s fine, it means that the Snap-In was just successfully loaded.&lt;/p&gt;

&lt;p&gt;For starters we can try to list add-ons installed on a site (note that the site should be EPiServer 7.5):&lt;/p&gt;

&lt;pre&gt;Get-EPiAddOns –ApplicationPath C:\EPiServer\ExampleEPiServerSite&lt;/pre&gt;

&lt;p&gt;Command returns all installed add-ons and their properties. In order to simplify commands input it is recommended to save current site path in a variable and use the variable as ApplicationPath parameter value. Also in order to reduce the noise we can pipe its output to the Select command:&lt;/p&gt;

&lt;pre&gt;$sitePath = “C:\EPiServer\ExampleEPiServerSite\wwwroot”
Get-EPiAddOns –ApplicationPath $sitePath | Select Id, Version&lt;/pre&gt;

&lt;p&gt;&lt;a href=&quot;/link/2c10309b795d41dbb67f912cac16b89d.png&quot;&gt;&lt;img title=&quot;PS&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;PS&quot; src=&quot;/link/545d9739b6b347b6bde7a68fe2e815ec.png&quot; width=&quot;244&quot; height=&quot;91&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What if we want to do the same for a site that has EPiServer 7? Use ApiPath parameter:&lt;/p&gt;

&lt;pre&gt;$apiPath = “C:\Program Files (x86)\EPiServer\Framework\7.5.394.2\Install\Tools”
Get-EPiAddOns –ApplicationPath $sitePath –ApiPath $apiPath | Select Id, Version&lt;/pre&gt;

&lt;p&gt;&lt;b&gt;&lt;i&gt;Note: &lt;/i&gt;&lt;/b&gt;&lt;i&gt;current version of CmdLets loads required Add-On system assemblies in AppDomain of the current PowerShell session, so it is better to not execute commands against different versions of EPiServer sites in the same command line session.&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;We can also filter output from the command:&lt;/p&gt;

&lt;pre&gt;Get-EPiAddOns –ApplicationPath $sitePath | Where {-not $_.IsSystemPackage} | Select Id, Version&lt;/pre&gt;

&lt;p&gt;We can disable Add-On like this:&lt;/p&gt;

&lt;pre&gt;Disable-EPiAddOn –ApplicationPath $sitePath –Id MyAddOn&lt;/pre&gt;

&lt;p&gt;Or uninstall it:&lt;/p&gt;

&lt;pre&gt;Remove-EPiAddOn –ApplicationPath $sitePath –Id MyAddOn&lt;/pre&gt;

&lt;p&gt;&lt;b&gt;&lt;i&gt;Note&lt;/i&gt;&lt;/b&gt;&lt;i&gt;: Please use Remove command with caution. Since this command doesn’t call BeforeUninstall method, the add-on that is going to be uninstalled does not have a chance to clean up after itself properly. &lt;/i&gt;&lt;/p&gt;

&lt;p&gt;We can pipe output from one command to another. For example we can disable all add-ons, which can be disabled:&lt;/p&gt;

&lt;pre&gt;Get-EPiAddOns –ApplicationPath $sitePath | Where {$_.CanBeDisabled} | %{Disable-EPiAddOn –ApplicationPath $sitePath –Id $_.Id } | Select Id, Version, IsDisabled&lt;/pre&gt;

&lt;p&gt;Then we can enable them back:&lt;/p&gt;

&lt;pre&gt;Get-EPiAddOns –ApplicationPath $sitePath | Where {$_.IsDisabled} | %{Enable-EPiAddOn –ApplicationPath $sitePath –Id $_.Id } | Select Id, Version, IsDisabled&lt;/pre&gt;

&lt;p&gt;If you don’t really fond of remembering all those commands you can use &lt;a href=&quot;https://github.com/SergVro/AddOnsManager&quot; target=&quot;_blank&quot;&gt;this small script&lt;/a&gt; that provides a basic interface for all add-on operations available from the command line. It allows you to select the site interactively from the same dialog that is used in the Deployment Center and then provides a menu interface for operations with selected site add-ons:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/link/eeea227ab4d04cffbf174c6e8163d28f.png&quot;&gt;&lt;img title=&quot;MainMenu&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;MainMenu&quot; src=&quot;/link/41dc00fc15194a328939366a4e6bf2c3.png&quot; width=&quot;244&quot; height=&quot;161&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</id><updated>2013-12-03T17:21:21.0000000Z</updated><summary type="html">Blog post</summary></entry> <entry><title>EPiServer 7 Connect for SharePoint: How to export pages</title><link href="https://world.optimizely.com/blogs/Sergey-Vorushilo/Dates/2013/2/EPiServer-7-Connect-for-SharePoint-How-to-export-pages/" /><id>&lt;p&gt;We recently released a new version of Connect for Microsoft SharePoint module. It is called EPiServer 7 Connect for SharePoint. You can find more information about it in this &lt;a href=&quot;http://world.episerver.com/Articles/Items/EPiServer-7-Connect-for-Sharepoint/&quot; target=&quot;_blank&quot;&gt;article&lt;/a&gt;. The module can be downloaded &lt;a href=&quot;http://world.episerver.com/Download/Categories/Connect-For/Connect-for-SharePoint/&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;This post is about a new feature that allows to export pages from a SharePoint site to EPiServer 7 CMS. &lt;/p&gt;  &lt;h1&gt;New features&lt;/h1&gt;  &lt;p&gt;The new version supports EPiServer 7 CMS and has two main new features: Microsoft SharePoint 2013 support and “Selectable export targets”. It also has some minor improvements and bug fixes; more details are available in the &lt;a href=&quot;http://world.episerver.com/Documentation/Items/Release-Notes/EPiServer-Connect/Release-Notes---EPiServer-7-Connect-for-Sharepoint/&quot;&gt;release notes&lt;/a&gt;. For those who are not familiar with this module, I would recommend to start with this &lt;a href=&quot;http://www.episerver.com/en/Products/EPiServer-Connect-for-SharePoint/&quot;&gt;page&lt;/a&gt; and &lt;a href=&quot;http://www.episerver.com/PageFiles/1882/Connect%20Sharepoint%20v1.3%20lowres.pdf&quot;&gt;product sheet&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;There is nothing special that I can say about the SharePoint 2013 support. Basically, it just works now with Microsoft SharePoint 2013 as well as with SharePoint 2010 and even SharePoint 2007. Here I want to tell you a bit about the “Selectable export targets” feature. So what does it mean, actually? It makes it possible for the user to choose how a SharePoint library item is exported to EPiServer CMS - as a file or as a page:&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;/link/4834354f4ff24fee8080eee70eeebdbe.jpg&quot; target=&quot;_blank&quot;&gt;&lt;img title=&quot;Selectable export targets feature&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;Selectable export targets feature&quot; src=&quot;/link/a65e5e0bc95b476a95f722a9d000c5be.jpg&quot; width=&quot;244&quot; height=&quot;76&quot; /&gt;&lt;/a&gt;&amp;#160; &lt;br /&gt;In the previous module versions, we always exported SharePoint libraries as files and SharePoint lists as pages. But for some libraries, like Wiki pages for example, it makes more sense to export as pages and not as files. Here is a scenario regarding how it can be used. &lt;/p&gt;  &lt;h1&gt;Exporting pages and files over a Content Channel&lt;/h1&gt;  &lt;p&gt;The environment that we are going to use consists of an EPiServer 7 CMS site with Alloy templates and Connect for SharePoint module, SharePoint 2013 Foundation server with Connect for SharePoint solution installed on it. The detailed instruction how to setup the module are available &lt;a href=&quot;http://world.episerver.com/Documentation/Items/Installation-Instructions/EPiServer-Connect/Sharepoint/Installation-Instructions--EPiServer-7-Connect-for-SharePoint/&quot;&gt;here&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;Let’s say we have a library on the SharePoint site containing web pages: a Wiki Pages library. We also have a Site Assets library containing images displayed on our Wiki pages and a Documents library containing some files. Links to the files in the documents library are also placed on the Wiki pages:&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;/link/49bee37c301a484abffe46ca9c3e9c92.jpg&quot; target=&quot;_blank&quot;&gt;&lt;img title=&quot;A test page in SharePoint 2013&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;A test page in SharePoint 2013&quot; src=&quot;/link/b954cf92ad51474cb93a7ce530dfc957.jpg&quot; width=&quot;153&quot; height=&quot;244&quot; /&gt;&lt;/a&gt;     &lt;br /&gt;Let’s try to export this page to the EPiServer 7 CMS site. The page itself can be exported with help of the Content Channel. But there are two different ways to deal with the related files. I am going to use both ways here. &lt;/p&gt;  &lt;h2&gt;Configure a Content Channel&lt;/h2&gt;  &lt;p&gt;First of all, we need to prepare a root page for the new pages that we are going to push from the SharePoint site. Let’s create a page of Standard Page type and name it “SharePoint Pages”. &lt;/p&gt;  &lt;p&gt;We also need a virtual root location for the files pushed from SharePoint. In order to maintain link’s integrity when a page is pushed from SharePoint to EPiServer, we need to take a look on a relative link paths used by SharePoint. For images placed on our sample page we can see that relative path starts with /SiteAssets/ – similar to the name of the library. So we need to provide the same root path for the images in the EPiServer CMS site. Let’s add a new versioning (or native) virtual path provider with virtual path ~/SiteAssets/:&lt;/p&gt;  &lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 500px; width: 97.5%; background-color: #f4f4f4&quot;&gt;   &lt;pre id=&quot;codeSnippet&quot; style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;add&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;showInFileManager&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&amp;quot;true&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;virtualName&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&amp;quot;SiteAssets&amp;quot;&lt;/span&gt; &lt;br /&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;virtualPath&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&amp;quot;~/SiteAssets/&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;bypassAccessCheck&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&amp;quot;false&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;useRouting&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&amp;quot;true&amp;quot;&lt;/span&gt; &lt;br /&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&amp;quot;SiteAssets&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&amp;quot;EPiServer.Web.Hosting.VirtualPathVersioningProvider, &lt;br /&gt;EPiServer&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Now we can create a Content channel on the EPiServer site. Go to the Admin mode, Admin tab, Content Channels and press the Add button. Name the channel My Channel, and select a root page for the new pages and root location for files. Select Standard Page type as a default page type and map its PageName property to “Name” and MainBody to “Wiki Content”:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/link/32d5754cca4c4adbb22704d4772584cd.jpg&quot; target=&quot;_blank&quot;&gt;&lt;img title=&quot;Content Channel settings&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;Content Channel settings&quot; src=&quot;/link/cae2b9f3672e426e8a46c2532faa590b.jpg&quot; width=&quot;163&quot; height=&quot;244&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;Configure a Virtual Path Provider for SharePoint&lt;/h2&gt;

&lt;p&gt;We also need to configure access to the Documents library files, so that links to documents placed on a page will work. Here we will use a second approach for files: instead of pushing files to CMS we will just configure Virtual Path Provider for SharePoint, so that files can be downloaded directly from the SharePoint site. If you inspect the path to the Documents library items you will find that virtual path is actually /Shared Documents/. The new VPP can be added using installer or by adding the following configuration block to the virtualPathProviders node in the EPiServerFramework.config:&lt;/p&gt;

&lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 300px; width: 97.5%; background-color: #f4f4f4&quot;&gt;
  &lt;pre id=&quot;codeSnippet&quot; style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;add&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&amp;quot;SharedDocuments&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;showInFileManager&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&amp;quot;true&amp;quot;&lt;/span&gt; &lt;br /&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;bypassAccessCheck&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&amp;quot;false&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;virtualPath&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&amp;quot;~/Shared Documents/&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;isMOSS&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&amp;quot;True&amp;quot;&lt;/span&gt; &lt;br /&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;wssSiteUrl&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&amp;quot;http://sharepointsite&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;wssDomainName&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&amp;quot;&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;wssRootFolder&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&amp;quot;Documents&amp;quot;&lt;/span&gt; &lt;br /&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;wssLogin&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&amp;quot;Administrator&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;wssPassword&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&amp;quot;pas$w0rd&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;useImpersonation&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&amp;quot;False&amp;quot;&lt;/span&gt; &lt;br /&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;virtualName&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&amp;quot;SharedDocuments&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;useRouting&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&amp;quot;true&amp;quot;&lt;/span&gt; &lt;br /&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;customFileSummary&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&amp;quot;~/WSSFileSummary.config&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;useCache&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&amp;quot;True&amp;quot;&lt;/span&gt; &lt;br /&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;cacheExpirationTime&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&amp;quot;30&amp;quot;&lt;/span&gt; &lt;br /&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&amp;quot;EPiServer.VirtualPathWssProvider.VirtualPathWssProvider, &lt;br /&gt;EPiServer.VirtualPathWssProvider&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;A few things to note here: the virtualPath attribute should be ~/Shared Documents/, so that relative links from pages to the Documents library will be served by the new VPP and wssRootFolder should contain the library name “Documents”, so that files from the library will be available in CMS by the same virtual path as on SharePoint site.&lt;/p&gt;

&lt;h2&gt;Configuring a channel on the SharePoint site&lt;/h2&gt;

&lt;p&gt;Open the SharePoint site and go to the Site settings and find EPiServer Connect for SharePoint link. Create a new channel and configure it according to the screenshot below:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/link/60655602b4bd40ebaae412716976d41e.jpg&quot; target=&quot;_blank&quot;&gt;&lt;img title=&quot;EPiServer CMS Channel settings in SharePoint 2013&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;EPiServer CMS Channel settings in SharePoint 2013&quot; src=&quot;/link/b34b84ac17914c668dbb19e27b1948e5.jpg&quot; width=&quot;244&quot; height=&quot;240&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After everything is configured, we can save the channel and press Resend Content in order to export our page to the EPiServer site. Now we can go to the EPiServer CMS site and take a look on what we have got:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/link/6e9dcb521cc3439d8152a0b4377e54a1.jpg&quot; target=&quot;_blank&quot;&gt;&lt;img title=&quot;The test page on the Alloy site&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;The test page on the Alloy site&quot; src=&quot;/link/efdd86af7d5748c5872a7e35ed6bafd9.jpg&quot; width=&quot;151&quot; height=&quot;244&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you might notice, we have lost some styling here. We can fix this by adding SharePoint style sheets to the EPiServer CMS page template. The default SharePoint style sheets located in c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\LAYOUTS\1033\STYLES\COREV15.CSS. By linking this file to the page template, we get a much closer look:&lt;a name=&quot;_GoBack&quot;&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/link/7d0bb7c424af4e76bb496d5cfd44bfff.jpg&quot; target=&quot;_blank&quot;&gt;&lt;img title=&quot;The test page on the Alloy site with styles&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;The test page on the Alloy site with styles&quot; src=&quot;/link/6cb9827ec7c14b93a93c8c76d9951f48.jpg&quot; width=&quot;160&quot; height=&quot;244&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Important note:&lt;/b&gt; Unfortunately, there is a bug in EPiServer 7 that doesn’t allow to update values of page properties of the PropertyXhtmlString type over the Content Channel. So if you try to follow the steps described here, you might notice that a page is successfully imported to the EPiServer site during the initial resend content operation, but it is not updated with subsequent import operations. A fix for the bug is available with &lt;a href=&quot;http://world.episerver.com/Articles/Items/EPiServer-7---Patch-1/&quot; target=&quot;_blank&quot;&gt;EPiServer 7 patch 1&lt;/a&gt;.&lt;/p&gt;</id><updated>2013-02-27T17:16:33.0000000Z</updated><summary type="html">Blog post</summary></entry> <entry><title>Navigate to Edit mode instead of Dashboard in EPiServer CMS 6</title><link href="https://world.optimizely.com/blogs/Sergey-Vorushilo/Dates/2012/11/Navigate-to-Edit-mode-instead-of-Dashboard-in-EPiServer-CMS-6/" /><id>&lt;p&gt;There is a &lt;a href=&quot;/link/486fab253b5e4b698980cfedbb7d1ed0.aspx?epslanguage=en&quot;&gt;question&lt;/a&gt; on the forum regarding how to change the default mode when navigating to the protected path in EPiServer CMS 6. Customer wants to get into Edit mode instead of Dashboard when navigating to &amp;lt;yourSiteUrl&amp;gt;/&amp;lt;yourProtectedUrl&amp;gt;. I think that answer to this question worth a small post here.&lt;/p&gt;  &lt;p&gt;Routing to the Dashboard is controlled by a special module called EPiServer.Shell.Web.Routing.ShellRoutingModule. It can be replaced with your own implementation. Here is how it can look like if you want your users to be redirected to Edit mode instead of Dashboard:&lt;/p&gt;  &lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 800px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;   &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&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; CustomRoutingModule : UrlRoutingModule&lt;br /&gt;   {&lt;br /&gt;       &lt;span style=&quot;color: #0000ff&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;object&lt;/span&gt; _orignalPathKey = &lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;object&lt;/span&gt;();&lt;br /&gt;&lt;br /&gt;       &lt;span style=&quot;color: #008000&quot;&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;br /&gt;       &lt;span style=&quot;color: #008000&quot;&gt;/// Matches the HTTP request to a route, retrieves the handler for that route, and sets the handler as the HTTP handler for the current request.&lt;/span&gt;&lt;br /&gt;       &lt;span style=&quot;color: #008000&quot;&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;br /&gt;       &lt;span style=&quot;color: #008000&quot;&gt;/// &amp;lt;param name=&amp;quot;context&amp;quot;&amp;gt;Encapsulates all HTTP-specific information about an individual HTTP request.&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;br /&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; &lt;span style=&quot;color: #0000ff&quot;&gt;void&lt;/span&gt; PostResolveRequestCache(HttpContextBase context)&lt;br /&gt;       {&lt;br /&gt;           &lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt; protectedPath = EPiServer.Shell.Paths.ProtectedRootPath;&lt;br /&gt;           &lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt; requestedPath = context.Request.CurrentExecutionFilePath;&lt;br /&gt;           &lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt; (&lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt;.Equals(protectedPath.TrimEnd(&lt;span style=&quot;color: #006080&quot;&gt;&#39;/&#39;&lt;/span&gt;), requestedPath.TrimEnd(&lt;span style=&quot;color: #006080&quot;&gt;&#39;/&#39;&lt;/span&gt;), StringComparison.OrdinalIgnoreCase))&lt;br /&gt;           {&lt;br /&gt;               context.Items[_orignalPathKey] = requestedPath;&lt;br /&gt;               context.RewritePath(protectedPath + &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;cms/edit/default.aspx&amp;quot;&lt;/span&gt;);&lt;br /&gt;           }&lt;br /&gt;&lt;br /&gt;           &lt;span style=&quot;color: #0000ff&quot;&gt;base&lt;/span&gt;.PostResolveRequestCache(context);&lt;br /&gt;       }&lt;br /&gt;&lt;br /&gt;       &lt;span style=&quot;color: #008000&quot;&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;br /&gt;       &lt;span style=&quot;color: #008000&quot;&gt;/// Assigns the HTTP handler for the current request to the context.&lt;/span&gt;&lt;br /&gt;       &lt;span style=&quot;color: #008000&quot;&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;br /&gt;       &lt;span style=&quot;color: #008000&quot;&gt;/// &amp;lt;param name=&amp;quot;context&amp;quot;&amp;gt;Encapsulates all HTTP-specific information about an individual HTTP request.&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;br /&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; &lt;span style=&quot;color: #0000ff&quot;&gt;void&lt;/span&gt; PostMapRequestHandler(HttpContextBase context)&lt;br /&gt;       {&lt;br /&gt;           &lt;span style=&quot;color: #0000ff&quot;&gt;base&lt;/span&gt;.PostMapRequestHandler(context);&lt;br /&gt;&lt;br /&gt;           &lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt; requestedPath = context.Items[_orignalPathKey] &lt;span style=&quot;color: #0000ff&quot;&gt;as&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt;;&lt;br /&gt;           &lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt; (requestedPath != &lt;span style=&quot;color: #0000ff&quot;&gt;null&lt;/span&gt;)&lt;br /&gt;           {&lt;br /&gt;               context.RewritePath(requestedPath);&lt;br /&gt;           }&lt;br /&gt;       }&lt;br /&gt;   }&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;You also need to replace ShellRoutingModule with a CustomRoutingModule in the web.config in configuration/system.webServer/modules:&lt;/p&gt;

&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;
  &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;span style=&quot;color: #008000&quot;&gt;&amp;lt;!-- add name=&amp;quot;ShellRoutingModule&amp;quot; type=&amp;quot;EPiServer.Shell.Web.Routing.ShellRoutingModule, EPiServer.Shell&amp;quot; /--&amp;gt;&lt;/span&gt;&lt;br /&gt;   &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;add&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&amp;quot;CustomRoutingModule&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&amp;quot;MyRoutingModule.CustomRoutingModule, MyRoutingModule&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;After that, your users will be able to navigate to Edit mode with the same URL that before was used for Dashboard. However, the Start menu and Dashboard context menu will navigate to Edit mode as well, thus making Dashboard unavailable from menus. To fix this, you need to remove default routes for the Shell module defined in C:\Program Files (x86)\EPiServer\Framework\6.2.267.1\ Application\UI\module.config:&lt;/p&gt;

&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;
  &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;...&lt;br /&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;route&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span style=&quot;color: #008000&quot;&gt;&amp;lt;!--defaults&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #008000&quot;&gt;    &amp;lt;add key=&amp;quot;moduleArea&amp;quot; value=&amp;quot;Shell&amp;quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #008000&quot;&gt;    &amp;lt;add key=&amp;quot;controller&amp;quot; value=&amp;quot;Dashboard&amp;quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #008000&quot;&gt;    &amp;lt;add key=&amp;quot;action&amp;quot; value=&amp;quot;Index&amp;quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #008000&quot;&gt;    &amp;lt;add key=&amp;quot;id&amp;quot; value=&amp;quot;&amp;quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #008000&quot;&gt;  &amp;lt;/defaults--&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;route&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;...&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;The last changes will affect all EPiServer sites on the server, so you might consider creating a copy of the whole folder containing module.config and pointing physicalPath attribute of the EPiServerShell virtual path provider to the new folder.&lt;/p&gt;</id><updated>2012-11-08T15:40:15.0000000Z</updated><summary type="html">Blog post</summary></entry> <entry><title>Moving to a new LocalizationService API in EPiServer 7</title><link href="https://world.optimizely.com/blogs/Sergey-Vorushilo/Dates/2012/7/Moving-to-a-new-LocalizationService-API-in-EPiServer-7/" /><id>&lt;p&gt;This is a short note about replacing the LanguageManager with a new LocalizationService API&lt;font style=&quot;background-color: #ffff00&quot;&gt;&lt;/font&gt; when upgrading from EPiServer 6 to EPiServer 7. Actually such replacement is not mandatory, since LanguageManager is still there, but it is marked as obsolete and delegates all calls to the LocalizationService.&lt;/p&gt;  &lt;h2&gt;Replacements&lt;/h2&gt;  &lt;p&gt;The LocalizationService class is located in EPiServer.Framework assembly in EPiServer.Framework.Localization namespace, so you might need to add a reference to your project.&lt;/p&gt;  &lt;p&gt;Here is a summary of what needs to be replaced in order to use the new API.&lt;/p&gt;  &lt;p&gt;Simple translation:&lt;/p&gt;  &lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;2&quot;&gt;&lt;tbody&gt;     &lt;tr class=&quot;cms6&quot;&gt;       &lt;th&gt;EPiServer 6&lt;/th&gt;        &lt;td&gt;         &lt;div id=&quot;codeSnippetWrapper&quot;&gt;           &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #fff; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;LanguageManager.Instance.Translate(key)&lt;/pre&gt;
        &lt;/div&gt;
      &lt;/td&gt;
    &lt;/tr&gt;

    &lt;tr class=&quot;cms7&quot;&gt;
      &lt;th&gt;EPiServer 7&lt;/th&gt;

      &lt;td&gt;General usage: 
        &lt;div id=&quot;codeSnippetWrapper&quot;&gt;
          &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #fff; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;LocalizationService.Current.GetString(key)&lt;/pre&gt;

          &lt;br /&gt;&lt;/div&gt;
In Web Forms pages/controls:* 

        &lt;div id=&quot;codeSnippetWrapper&quot;&gt;
          &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #fff; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;this&lt;/span&gt;.Translate(key)&lt;/pre&gt;

          &lt;br /&gt;&lt;/div&gt;
In MVC view: 

        &lt;div id=&quot;codeSnippetWrapper&quot;&gt;
          &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #fff; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;Html.Translate(key)&lt;/pre&gt;
        &lt;/div&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;&lt;/table&gt;

&lt;p&gt;Translate with fallback value: &lt;/p&gt;

&lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;2&quot;&gt;&lt;tbody&gt;
    &lt;tr class=&quot;cms6&quot;&gt;
      &lt;th&gt;EPiServer 6&lt;/th&gt;

      &lt;td&gt;
        &lt;div id=&quot;codeSnippetWrapper&quot;&gt;
          &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #fff; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;LanguageManager.Instance.TranslateFallback(key, fallback)&lt;/pre&gt;
        &lt;/div&gt;
      &lt;/td&gt;
    &lt;/tr&gt;

    &lt;tr class=&quot;cms7&quot;&gt;
      &lt;th&gt;EPiServer 7&lt;/th&gt;

      &lt;td&gt;General usage: 
        &lt;div id=&quot;codeSnippetWrapper&quot;&gt;
          &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #fff; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;LocalizationService.Current.GetString(key, fallback)&lt;/pre&gt;

          &lt;br /&gt;&lt;/div&gt;
In Web Forms pages/controls:* 

        &lt;div id=&quot;codeSnippetWrapper&quot;&gt;
          &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #fff; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;this&lt;/span&gt;.TranslateFallback(key, fallback)&lt;/pre&gt;

          &lt;br /&gt;&lt;/div&gt;
In MVC view: 

        &lt;br /&gt;

        &lt;div id=&quot;codeSnippetWrapper&quot; title=&quot;This method is not implemented in EPiServer 7 Preview, but will be available in the release&quot;&gt;
          &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #fff; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot; class=&quot;grayout&quot;&gt;Html.TranslateFallback(key, fallback)&lt;/pre&gt;
        &lt;/div&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;&lt;/table&gt;

&lt;p&gt;Translate and adapt value for use in a client script: &lt;/p&gt;

&lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;2&quot;&gt;&lt;tbody&gt;
    &lt;tr class=&quot;cms6&quot;&gt;
      &lt;th&gt;EPiServer 6&lt;/th&gt;

      &lt;td&gt;
        &lt;div id=&quot;codeSnippetWrapper&quot;&gt;
          &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #fff; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;LanguageManager.Instance.TranslateForScript(key)&lt;/pre&gt;
        &lt;/div&gt;
      &lt;/td&gt;
    &lt;/tr&gt;

    &lt;tr class=&quot;cms7&quot;&gt;
      &lt;th&gt;EPiServer 7&lt;/th&gt;

      &lt;td&gt;General usage: 
        &lt;div id=&quot;codeSnippetWrapper&quot;&gt;
          &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #fff; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;ScriptResourceHelper.PrepareResourceForScript(&lt;br /&gt; LocalizationService.Current.GetString(key))&lt;/pre&gt;

          &lt;br /&gt;&lt;/div&gt;
In Web Forms pages/controls:* 

        &lt;div id=&quot;codeSnippetWrapper&quot;&gt;
          &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #fff; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;this&lt;/span&gt;.TranslateForScript(key)&lt;/pre&gt;

          &lt;br /&gt;&lt;/div&gt;
In MVC view: 

        &lt;div id=&quot;codeSnippetWrapper&quot;&gt;
          &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #fff; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;Html.TranslateForScript(key)&lt;/pre&gt;
        &lt;/div&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;&lt;/table&gt;
&lt;style type=&quot;text/css&quot;&gt;
















table {border-collapse:collapse; width: 100%;}
td, th {border: 1px dotted #555;}
th {width: 80px; font-wight: normal;}

tr.cms6 {background-color: #fff;}
tr.cms7 {background-color: #fff;}
.grayout {color: #555;} &lt;/style&gt;

&lt;p&gt;* There is also a protected helper property named LocalizationService that can be used in page templates and user controls that inherit from one of these base classes:&lt;/p&gt;

&lt;div id=&quot;codeSnippetWrapper&quot;&gt;
  &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #fff; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;EPiServer.PageBase&lt;br /&gt;EPiServer.ContentBaseWebForm&lt;br /&gt;EPiServer.UserControlBase&lt;br /&gt;EPiServer.ContentBaseUserControl&lt;/pre&gt;
&lt;/div&gt;

&lt;br /&gt;

&lt;h2&gt;How to mock the LocalizationService&lt;/h2&gt;

&lt;p&gt;As a general recommendation, mainly because of testability, it is better to use a constructor dependency injection instead of static LocalizationService.Current. &lt;/p&gt;

&lt;p&gt;If order to mock the LocalizationService in a unit test you need to setup GetStringByCulture method: &lt;/p&gt;

&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #fff; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;
  &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #fff; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;var localizationServiceMock = &lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; Mock&amp;lt;LocalizationService&amp;gt;(&lt;span style=&quot;color: #0000ff&quot;&gt;null&lt;/span&gt;);&lt;br /&gt;localizationServiceMock.Setup(s =&amp;gt; s.GetStringByCulture(It.IsAny&amp;lt;String&amp;gt;(), &lt;br /&gt;     It.IsAny&amp;lt;FallbackBehaviors&amp;gt;(), It.IsAny&amp;lt;CultureInfo&amp;gt;())).Returns(String.Empty);&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;More details about the new localization API can be found in “Using the Localization Service” chapter in &lt;a href=&quot;http://world.episerver.com/Documentation/Categories/Products/EPiServer-CMS/&quot;&gt;SDK Documentation EPiServer 7 – Framework&lt;/a&gt;.&lt;/p&gt;</id><updated>2012-07-25T20:59:10.0000000Z</updated><summary type="html">Blog post</summary></entry> <entry><title>Add-Ons development environment</title><link href="https://world.optimizely.com/blogs/Sergey-Vorushilo/Dates/2012/7/Add-Ons-development-environment/" /><id>&lt;p&gt;&lt;span&gt;This post is about how to setup an environment for developing add-ons for &lt;a href=&quot;/link/1f3f4fec6cc24a67a2061153a423622d.aspx&quot;&gt;EPiServer 7&lt;/a&gt;. By development environment here I mean a possibility for an add-on developer to make some changes in code, build the project and see those changes on a development site without manual operations like copying files and so on. I recommend your to read the Add-Ons section of Developer Guide in the &lt;/span&gt;&lt;a href=&quot;/link/db6ebc290a6c47df8fb83a53c83f4109.aspx&quot; target=&quot;_blank&quot;&gt;&lt;span&gt;EPiServer 7 Framework SDK&lt;/span&gt;&lt;/a&gt;&lt;span&gt;, where you can find all information about the Add-On system. However you don’t need to know everything about the Add-On system in order to follow simple and detailed steps described here. &lt;/span&gt;&lt;/p&gt;
&lt;h2&gt;&lt;span&gt;Public or protected. &lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span&gt;First of all you need to decide whether your add-on will be public or protected. The difference between public and protected add-ons is in location where they are placed on a site. Public add-ons by default resides in “modules” folder under the site root, for example C:\EPiServer\Sites\ExampleEPiServerSite\modules\. Protected add-ons can be found in “Modules” subfolder under the site VPP folder, for example C:\EPiServer\VPP\ExampleEPiServerSite\Modules\. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Public add-ons doesn’t have any access restrictions and this type of add-on should be preferred if you are planning to have a user interface or some kind of content that should be available for the site visitors. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Protected add-on type should be preferred if you are going to create an add-on that will be used mostly by site editors or administrators. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Add-ons binaries for both protected and public add-ons are stored by default in “modulesbin” folder under the site root: C:\EPiServer\Sites\ExampleEPiServerSite\modulesbin\&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;In this guide we are going to create an add-on with a simple shared block, so it will be a public add-on.&lt;/span&gt;&lt;/p&gt;
&lt;h2&gt;&lt;span style=&quot;color: #333333;&quot;&gt;Creating an add-on project&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span&gt;All steps described below assumes that you have &lt;a href=&quot;/link/1f3f4fec6cc24a67a2061153a423622d.aspx&quot;&gt;EPiServer 7&lt;/a&gt; installed with the Alloy sample site. By default the site location is C:\EPiServer\Sites\ExampleEPiServerSite. Also you need to download &lt;/span&gt;&lt;a href=&quot;http://nuget.codeplex.com/releases&quot; target=&quot;_blank&quot;&gt;&lt;span&gt;nuget.exe command line tool&lt;/span&gt;&lt;/a&gt;&lt;span&gt; and put it in a location listed in your &lt;a href=&quot;http://en.wikipedia.org/wiki/PATH_(variable)&quot; target=&quot;_blank&quot;&gt;PATH&lt;/a&gt;. &lt;br /&gt;So here are the steps:&lt;/span&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span&gt;Open Alloy project with Visual Studio. The project file is located under the site root folder: C:\EPiServer\Sites\ExampleEPiServerSite. &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Right click on solution tree and select Add &amp;gt; New project. &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Select ASP.NET Empty Web Application or any other project type that fits best for your add-on. &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;If you are going to create a public Add-On select&amp;nbsp; C:\EPiServer\Sites\ExampleEPiServerSite\modules folder for the new project location. &lt;br /&gt;If you are going to create a protected Add-On select C:\EPiServer\VPP\ExampleEPiServerSite\Modules folder for the new project location. &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Type MyAddOn in the project name field and click Ok. Now your solution should contain two projects - the site project and the add-on project: &lt;br /&gt;&lt;img title=&quot;Projects in solution&quot; alt=&quot;Projects in solution&quot; src=&quot;/link/3171cad0997f405c9306b2a51bfa1444.aspx&quot; height=&quot;137&quot; width=&quot;284&quot; /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Open AssebmlyInfo.cs file from the add-on project and enter some non-empty values for the AssemblyCompany and AssemblyDescription attributes. &lt;span&gt;This step is required in order to provide NuGet with package mandatory attributes. &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Open command line and go to the folder with the new project: C:\EPiServer\Sites\ExampleEPiServerSite\modules\MyAddOn and run command: &lt;strong&gt;nuget.exe spec&lt;/strong&gt;. The NuGet manifest file will be created.&amp;nbsp; &lt;br /&gt;&lt;/span&gt;&lt;a href=&quot;/link/eef453953dfe444ca51e10b826aa6dde.aspx&quot;&gt;&lt;span&gt;&lt;img style=&quot;display: inline;&quot; title=&quot;nuget spec&quot; alt=&quot;nuget spec&quot; src=&quot;/link/58556d9d3329472486f589e1331b5854.aspx&quot; height=&quot;65&quot; width=&quot;356&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;span&gt; &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Include MyAddOn.nuspec manifest file in the new project, so it will be easily accessible from the Solution explorer. &lt;br /&gt;&lt;/span&gt;&lt;img title=&quot;NuSpec file in the add-on project&quot; alt=&quot;NuSpec file in the add-on project&quot; src=&quot;/link/ab7e555c27e94c3b876183ba52ab7505.aspx&quot; height=&quot;139&quot; width=&quot;279&quot; /&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&lt;span&gt;Open manifest file and edit &lt;strong&gt;tags&lt;/strong&gt; value, set it to &lt;strong&gt;EPiServerPublicModulePackage&lt;/strong&gt; for public package or &lt;strong&gt;EPiServerModulePackage &lt;/strong&gt;for protected package. &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;text-align: left; line-height: 12pt; background-color: #fff; margin: 20px 0px 10px; width: 97.5%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;&quot;&gt;
&lt;pre id=&quot;codeSnippet&quot; style=&quot;text-align: left; line-height: 12pt; background-color: #fff; margin: 0em; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;xml&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;version&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;1.0&quot;&lt;/span&gt;?&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;package&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;metadata&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;$id$&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;version&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;$version$&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;version&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;title&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;$title$&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;title&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;authors&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;$author$&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;authors&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;owners&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;$author$&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;owners&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;requireLicenseAcceptance&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;false&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;requireLicenseAcceptance&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;description&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;$description$&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;description&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;releaseNotes&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;Summary of changes made in this release of the package.&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;releaseNotes&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;copyright&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;Copyright 2012&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;copyright&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;tags&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;EPiServerPublicModulePackage&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;tags&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;metadata&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;package&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Then we need to add several automatic operations that will be executed after the project build: copy add-on binaries to the “modulesbin” folder, restart the site and create an add-on package file. &lt;br /&gt;&lt;/span&gt;&lt;span&gt;Unload MyAddOn project and open the project file in editor. &lt;br /&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;Find the &lt;strong&gt;AfterBuild&lt;/strong&gt; target, uncomment it and replace with the following targets:&lt;/span&gt;&lt;/span&gt;
&lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;text-align: left; line-height: 12pt; background-color: #fff; margin: 20px 0px 10px; width: 97.5%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 700px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;&quot;&gt;
&lt;pre id=&quot;codeSnippet&quot; style=&quot;text-align: left; line-height: 12pt; background-color: #fff; margin: 0em; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;Target&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;AfterBuild&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;DependsOnTargets&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;CopyOutputToModulesBin; RestartSite; CreateAddOnPackage; &quot;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;Target&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;PropertyGroup&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;DevelopmentSitePath&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;c:\EPiServer\Sites\ExampleEPiServerSite&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;DevelopmentSitePath&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;PropertyGroup&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;Target&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;CopyOutputToModulesBin&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span style=&quot;color: #008000;&quot;&gt;&amp;lt;!-- Copy project output to the site modulesbin folder --&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;ItemGroup&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;AddOnFilesToCopy&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;Include&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;$(OutputPath)*.*&quot;&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;ItemGroup&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;Copy&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;SourceFiles&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;@(AddOnFilesToCopy)&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;DestinationFolder&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;$(DevelopmentSitePath)\modulesbin\&quot;&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;Target&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;Target&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;RestartSite&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span style=&quot;color: #008000;&quot;&gt;&amp;lt;!-- Triggers restart of the site --&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;WriteLinesToFile&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;File&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;$(DevelopmentSitePath)\bin\restart.txt&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;Lines&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;Temp file for triggering restart of the web application&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;Overwrite&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;true&quot;&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;Delete&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;Files&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;$(DevelopmentSitePath)\bin\restart.txt&quot;&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;Target&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;Target&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;CreateAddOnPackage&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;Condition&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot; &#39;$(Configuration)&#39; == &#39;Release&#39; &quot;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span style=&quot;color: #008000;&quot;&gt;&amp;lt;!-- Creates an Add-On package and deploys it to the site package repository --&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;PropertyGroup&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;PackageOutputDir&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;c:\EPiServer\VPP\ExampleEPiServerSite\ModulesRepository&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;PackageOutputDir&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;PropertyGroup&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;Exec&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;Command&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;nuget pack $(MSBuildProjectFile) -OutputDirectory $(PackageOutputDir)&quot;&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;Target&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;span&gt; &lt;br /&gt;The &lt;strong&gt;CopyOutputToModulesBin&lt;/strong&gt; target copies project output binaries to the site “modulesbin” folder. &lt;br /&gt;The &lt;strong&gt;RestartSite&lt;/strong&gt; target – triggers site restart by writing and deleting a temp file to the sites bin folder. The site restart is required to reload add-on assemblies to the site application domain, since placing an assembly to the “modulesbin” folder doesn’t restart the site automatically as it happens when you place an assembly in the sites “bin” folder. &lt;br /&gt;The &lt;strong&gt;CreateAddOnPackage&lt;/strong&gt; target – creates a package and places it to the site local package repository. This target is not required on every build, so we have a condition to run it only in Release configuration. When you are ready to publish your add-on – just build it in Release configuration. But if you want your add-on to be visible in the list of installed add-ons on the site, the package file needs to be placed in the site local package repository. &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Reload the project in Visual Studio and build it in Release configuration. &lt;/span&gt;&lt;span&gt;If everything was configured correctly you should find a new package &lt;strong&gt;MyAddOn.1.0.0.0.nupkg&lt;/strong&gt; in the C:\EPiServer\VPP\ExampleEPiServerSite\ModulesRepository folder and a new assembly &lt;strong&gt;MyAddOn.dll&lt;/strong&gt; in the C:\EPiServer\Sites\ExampleEPiServerSite\modulesbin\&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;In order to be able to see MyAddOn in the Add-Ons management UI we should add an add-on reference to C:\EPiServer\VPP\ExampleEPiServerSite\Modules\Packages.config &lt;br /&gt;&lt;/span&gt;
&lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;text-align: left; line-height: 12pt; background-color: #fff; margin: 20px 0px 10px; width: 97.5%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;&quot;&gt;
&lt;pre id=&quot;codeSnippet&quot; style=&quot;text-align: left; line-height: 12pt; background-color: #fff; margin: 0em; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;xml&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;version&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;1.0&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;encoding&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;utf-8&quot;&lt;/span&gt;?&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;packages&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;package&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;CMS&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;version&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;1.0.135&quot;&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;package&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;EPiServer.Packaging&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;version&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;1.0.776&quot;&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;package&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;EPiServer.Packaging.UI&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;version&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;1.0.776&quot;&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;package&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;Shell&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;version&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;1.0.140&quot;&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;  &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;package&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;MyAddOn&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;version&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;1.0.0.0&quot;&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/strong&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;packages&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;Open the site in the web browser, log-in and navigate to the Add-Ons management interface. You should find a new add-on in the list of installed add-ons:&lt;/span&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/span&gt;&lt;a href=&quot;/link/3aebb3d35f8e4b55bce35c6a2e33c1d2.aspx&quot;&gt;&lt;span&gt;&lt;img style=&quot;background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;&quot; title=&quot;AddOnsManagementUI&quot; alt=&quot;AddOnsManagementUI&quot; src=&quot;/link/7e0b9a4ce7d24437899944960668585e.aspx&quot; height=&quot;121&quot; width=&quot;243&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Note &lt;/strong&gt;regarding library references: if you are going to add a reference to one of the EPiServer libraries or a library that is a part of some other add-on to your project, please make sure you set &quot;Copy Local&quot; to False, so the referenced library will not be copied to the add-on project output folder:&lt;/p&gt;
&lt;p&gt;&lt;img title=&quot;CopyLocal should be set to false&quot; alt=&quot;CopyLocal should be set to false&quot; src=&quot;/link/124757e9a0a14472895ecde517817c20.aspx&quot; height=&quot;302&quot; width=&quot;290&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;h2&gt;Injection shared block&lt;/h2&gt;
&lt;p&gt;Ok, so now we have everything in place. It’s time to add some functionality to our add-on, just to prove that our environment works fine. The steps described below assumes that MyAddOn is a public add-on, since the shared block template should be visible for the site visitors.&lt;/p&gt;
&lt;p&gt;Lets start with adding some references to MyAddOn project. We going to need &lt;strong&gt;EPiServer&lt;/strong&gt;, &lt;strong&gt;EPiServer.BaseLibrary &lt;/strong&gt;and &lt;strong&gt;EPiServer.Data&lt;/strong&gt; assemblies. You can reference them from the site bin folder.&lt;/p&gt;
&lt;p&gt;Now we need to create a new shared block type. Add a new class to MyAddOn project, name it InjectionBlockType. Add a property with type string and name InjectionValue:&lt;/p&gt;
&lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;&quot;&gt;
&lt;div id=&quot;codeSnippet&quot; style=&quot;text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;
&lt;pre style=&quot;text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;using&lt;/span&gt; System.ComponentModel.DataAnnotations;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;using&lt;/span&gt; EPiServer.Core;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;using&lt;/span&gt; EPiServer.DataAnnotations;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;using&lt;/span&gt; EPiServer.Web;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;&amp;nbsp;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;namespace&lt;/span&gt; MyAddOn&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;{&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;    [ContentType(&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;    DisplayName = &lt;span style=&quot;color: #006080;&quot;&gt;&quot;Injection block&quot;&lt;/span&gt;,&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;    Description = &lt;span style=&quot;color: #006080;&quot;&gt;&quot;A block containing a property that doesn&#39;t have HTML encoding.&quot;&lt;/span&gt;)]&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&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; InjectionBlockType : BlockData&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;    {&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;        [BackingType(&lt;span style=&quot;color: #0000ff;&quot;&gt;typeof&lt;/span&gt;(PropertyLongString))]&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;        [UIHint(UIHint.Textarea)]&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;        &lt;span style=&quot;color: #0000ff;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;virtual&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;string&lt;/span&gt; InjectionValue { get; set; }&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;    }&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;}&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Then we need a template to render our block. Add a new Web User Control to MyAddOn project. Name it InjectionBlock. The markup of the template is very simple and should look like this:&lt;/p&gt;
&lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;&quot;&gt;
&lt;pre id=&quot;codeSnippet&quot; style=&quot;text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;&lt;span style=&quot;background-color: #ffff00;&quot;&gt;&amp;lt;%@ Control Language=&quot;C#&quot; AutoEventWireup=&quot;true&quot; CodeBehind=&quot;InjectionBlock.ascx.cs&quot; Inherits=&quot;MyAddOn.InjectionBlock, MyAddOn&quot; %&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: #ffff00;&quot;&gt;&amp;lt;%&lt;span id=&quot;lnum1&quot; style=&quot;color: #606060;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-size: 8pt; line-height: 12pt;&quot;&gt;=CurrentBlock.InjectionValue &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #ffff00;&quot;&gt;%&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Please, pay attention to the Inherits attribute value – we need to put add-on assembly name after the type name, so that template could be located.&lt;/p&gt;
&lt;p&gt;Open controls code behind and make it inherit from BlockControlBase&amp;lt;InjectionBlockType&amp;gt; :&lt;/p&gt;
&lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;&quot;&gt;
&lt;div id=&quot;codeSnippet&quot; style=&quot;text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;
&lt;pre style=&quot;text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;using&lt;/span&gt; EPiServer.Web;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;&amp;nbsp;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;namespace&lt;/span&gt; MyAddOn&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;{&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;    &lt;span style=&quot;color: #0000ff;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;partial&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;class&lt;/span&gt; InjectionBlock : BlockControlBase&amp;lt;InjectionBlockType&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;    {&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;    }&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;}&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;What we are basically doing here is just rendering a value entered by editor without encoding. Sounds dangerous? It is so, but it gives a lot of possibilities as well. You can use this block to embed whatever you like on a page: YouTube video, Twitter button, Google AdSense etc.&lt;/p&gt;
&lt;p&gt;Finally build the project and go to the site edit mode. In the block list press “Create a new block” button. Enter some name and select “Injection block” type. Now you should see a blank block editor – it’s ok, just toggle forms editing :&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/link/453361d895a64df6ab053d8a3aa93620.aspx&quot;&gt;&lt;img style=&quot;background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;&quot; title=&quot;image&quot; alt=&quot;image&quot; src=&quot;/link/67e4c6145c2840079dd4fc957d3fa9be.aspx&quot; height=&quot;140&quot; width=&quot;244&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You should see the editor for the InejctionValue property:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/link/86810ea6ec5b493d892be011565807bd.aspx&quot;&gt;&lt;img style=&quot;background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;&quot; title=&quot;image&quot; alt=&quot;image&quot; src=&quot;/link/63be45f1419b401f9bb56081e044a250.aspx&quot; height=&quot;49&quot; width=&quot;244&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Enter the following value:&lt;/p&gt;
&lt;p&gt;&lt;!-- .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; } --&gt;&lt;/p&gt;
&lt;div id=&quot;codeSnippetWrapper&quot;&gt;
&lt;div id=&quot;codeSnippet&quot; style=&quot;text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;
&lt;pre style=&quot;text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;&lt;span style=&quot;color: #006080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;style&lt;/span&gt;&lt;span style=&quot;color: #006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;h1&lt;/span&gt; {&lt;span style=&quot;color: #0000ff;&quot;&gt;color&lt;/span&gt;: &lt;span style=&quot;color: #006080;&quot;&gt;red;&lt;/span&gt; }&lt;span style=&quot;color: #006080;&quot;&gt;&amp;lt;&lt;/span&gt;/&lt;span style=&quot;color: #0000ff;&quot;&gt;style&lt;/span&gt;&lt;span style=&quot;color: #006080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Publish the block. Open Start/Alloy Plan page in the page tree and try to drop a new block to the content area on the bottom of the page. All headers should change color to red:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/link/8adc584f1c544f7baa971268d7295e85.aspx&quot;&gt;&lt;img style=&quot;background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;&quot; title=&quot;image&quot; alt=&quot;image&quot; src=&quot;/link/5738b74e00b8438eb3911ce97745d666.aspx&quot; height=&quot;213&quot; width=&quot;225&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Cool, huh? Well, maybe not. However we got a working development environment for creating real add-ons!&lt;/p&gt;</id><updated>2012-07-05T12:52:00.0000000Z</updated><summary type="html">Blog post</summary></entry> <entry><title>Language files Visual Studio Extension for EPiServer</title><link href="https://world.optimizely.com/blogs/Sergey-Vorushilo/Dates/2012/1/EPiServer-Language-files-Visual-Studio-Extension/" /><id>&lt;p&gt;As you certainly know, EPiServer localization is based on XML files with a certain structure. Working with translations in code is not hard, but I believe it could be even easier with a small extension, that I am going to introduce to you. This is a Visual Studio 2010 extension that has three main functions:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Show values of translation keys as a tool-tips.&lt;img src=&quot;https://lh3.googleusercontent.com/eGB-s4zjzhXY0cj1Pkiu2y-oO-R4cp97rmOr5Nc0WMXNf68lkFkBbbiYg-HN6bkVCdffa_Vk0llAdgqNvdAbynFtsuSrspYUzPs-6hww7j2jNmUUhHY&quot; alt=&quot;&quot; width=&quot;460&quot; height=&quot;260&quot; /&gt; &lt;/li&gt;
&lt;li&gt;Navigate to a line in a language file containing the key.&lt;img src=&quot;https://lh6.googleusercontent.com/H_s4tLHoZNdf20Ms6FOaNRw24pQFIHU2xxcZMjo9A_3j-qDZ_LhhNnO2Yiv-AyA9x2wbX7f5ohLq_Ff-oECDMSrZHJxFeVMVZ_NU0oUWz7BuM6pSf7M&quot; alt=&quot;&quot; width=&quot;418&quot; height=&quot;316&quot; /&gt; &lt;/li&gt;
&lt;li&gt;Copy to the clipboard an expression with path to the key selected in a language file.&lt;img src=&quot;https://lh4.googleusercontent.com/adqlDYKjwqHTrHaFtWfcAe2uD-o25rShLKH-f8K0LTbmjZEJ6VXockiKkjiz4kJn9JbpcAhAjlxVzRfeodHbxIbSRNWQGSt-id8XfMgT633XWM8O04c&quot; alt=&quot;&quot; width=&quot;501&quot; height=&quot;188&quot; /&gt; &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;br /&gt;In code editor all recognized translation keys are decorated with a thin border.&amp;nbsp; Tool-tips are shown if you hover a mouse pointer over a decorated translation key. Smart-tags used for navigation can be expanded with left mouse click or by pressing &quot;Ctrl + &lt;strong&gt;.&lt;/strong&gt;&quot; key combination.&lt;/p&gt;
&lt;p&gt;The extension can recognize two types of translation references: basic XPath &lt;em&gt;“/admin/settings/heading”&lt;/em&gt; and resource binding &lt;em&gt;&amp;lt;%$ Resources: EPiServer, admin.settings.heading %&amp;gt;&lt;/em&gt;. Relative paths like &lt;em&gt;Translate(“#heading”)&lt;/em&gt; and filtering by attribute value expressions&amp;nbsp; like &lt;em&gt;Translate(“/pagetypes/property[@name=’Description’]”)&lt;/em&gt; are not supported for now.&lt;/p&gt;
&lt;p&gt;The extension can be installed from Extension Manager in Visual Studio 2010 (select Online gallery and type “EPiServer” in the search request) or alternatively it can be downloaded from &lt;a href=&quot;http://visualstudiogallery.msdn.microsoft.com/a5e448e9-8997-44dc-b59a-4e3e9eba244e?SRC=VSIDE&quot;&gt;this page&lt;/a&gt;.&amp;nbsp; The source code for the extension is available &lt;a href=&quot;https://github.com/SergVro/EPiServer-Language-VSX&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;This project was born during a series of hack-days that we have here in EPiServer development team and it is not an official EPiServer release. You are very welcome to leave feedback and suggestions here in comments or on extensions &lt;a href=&quot;http://visualstudiogallery.msdn.microsoft.com/a5e448e9-8997-44dc-b59a-4e3e9eba244e&quot;&gt;page&lt;/a&gt;. Bugs can be reported and tracked &lt;a href=&quot;https://github.com/SergVro/EPiServer-Language-VSX/issues&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;</id><updated>2012-01-29T22:13:00.0000000Z</updated><summary type="html">Blog post</summary></entry> <entry><title>Custom conversions in CMO LPO test</title><link href="https://world.optimizely.com/blogs/Sergey-Vorushilo/Dates/2011/8/Custom-conversions-in-CMO-LPO-test/" /><id>&lt;p&gt;Today I was asked if it is possible to customize the behavior of LPO test so that the conversions is counted when user submit a form. Of course one of the solutions could be a separate page where user is redirected after a form submit and we can use that page as a conversion page in LPO test. On the other hand there is a more flexible way. Below is a code snippet that need to be placed in page template and called from a submit button event handler (or from any other event):&lt;/p&gt;  &lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; height: 552px; max-height: 600px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;   &lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;     &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum1&quot;&gt;   1:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;void&lt;/span&gt; IncreaseLpoConversion()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum2&quot;&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum3&quot;&gt;   3:&lt;/span&gt;     &lt;span style=&quot;color: #008000&quot;&gt;// Get reference to the current page (with WorkID)&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum4&quot;&gt;   4:&lt;/span&gt;     PageReference originalReference = LpoContextHelper.Instance.GetCurrentReference();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum5&quot;&gt;   5:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum6&quot;&gt;   6:&lt;/span&gt;     &lt;span style=&quot;color: #008000&quot;&gt;//Get LPO test containing page with PageReference equal originalReference&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum7&quot;&gt;   7:&lt;/span&gt;     LpoTestLight test = LpoHelper.Instance.GetTestByOriginal(originalReference.ToString());&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum8&quot;&gt;   8:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt; (!test.HasValues)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum9&quot;&gt;   9:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum10&quot;&gt;  10:&lt;/span&gt;         &lt;span style=&quot;color: #0000ff&quot;&gt;return&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum11&quot;&gt;  11:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum12&quot;&gt;  12:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum13&quot;&gt;  13:&lt;/span&gt;     &lt;span style=&quot;color: #008000&quot;&gt;// Get conversion page reference&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum14&quot;&gt;  14:&lt;/span&gt;     PageReference conversionReference;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum15&quot;&gt;  15:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt; (!PageReference.TryParse(test.Conversion.Reference, &lt;span style=&quot;color: #0000ff&quot;&gt;out&lt;/span&gt; conversionReference))&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum16&quot;&gt;  16:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum17&quot;&gt;  17:&lt;/span&gt;         &lt;span style=&quot;color: #0000ff&quot;&gt;return&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum18&quot;&gt;  18:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum19&quot;&gt;  19:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum20&quot;&gt;  20:&lt;/span&gt;     &lt;span style=&quot;color: #008000&quot;&gt;// Find if we were on some variation page and did not gathered statistics yet.&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum21&quot;&gt;  21:&lt;/span&gt;     &lt;span style=&quot;color: #008000&quot;&gt;// The cookie should be set by LPO module when user enters on Original or one of the Variation pages&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum22&quot;&gt;  22:&lt;/span&gt;     PageReference variationReference = LpoContextHelper.Instance.GetFromCookie(conversionReference);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum23&quot;&gt;  23:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt; (PageReference.IsNullOrEmpty(variationReference))&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum24&quot;&gt;  24:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum25&quot;&gt;  25:&lt;/span&gt;         &lt;span style=&quot;color: #0000ff&quot;&gt;return&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum26&quot;&gt;  26:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum27&quot;&gt;  27:&lt;/span&gt;     &lt;span style=&quot;color: #008000&quot;&gt;//Increase statistics&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum28&quot;&gt;  28:&lt;/span&gt;     CmoData.Instance.IncreaseConversionLpoPageViewAsync(test.GetPageIdByReference(variationReference.ToString()));&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum29&quot;&gt;  29:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum30&quot;&gt;  30:&lt;/span&gt;     &lt;span style=&quot;color: #008000&quot;&gt;// Save empty reference to cookie in order to avoid multiple conversions from single user&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum31&quot;&gt;  31:&lt;/span&gt;     LpoContextHelper.Instance.SetToCookie(conversionReference, PageReference.EmptyReference, test.GetCookieExpirationDate());&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum32&quot;&gt;  32:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum33&quot;&gt;  33:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;In order to make this code compile you need to reference EPiServer.Cmo.Core.dll and EPiServer.Cmo.Cms.dll.&lt;/p&gt;

&lt;p&gt;Since Conversion page is a mandatory in LPO test we need to set it to some page that is not visible to users otherwise visits on that page might be counted as a conversions. Note that depending on your needs, you can control if it is allowed to count multiple submits for the same user by changing “Multiple impressions and conversions” option in CMO Settings. &lt;/p&gt;</id><updated>2011-08-25T16:37:19.0000000Z</updated><summary type="html">Blog post</summary></entry> <entry><title>EPiServer Connect for SharePoint 2.4 and Virtual Path Provider file check out</title><link href="https://world.optimizely.com/blogs/Sergey-Vorushilo/Dates/2011/6/EPiServer-Connect-24-for-SharePoint-Virtual-Path-Provider-file-check-out/" /><id>&lt;p&gt;The new version of EPiServer Connect for Microsoft SharePoint offers a lot of fixes, mostly related to overcome changes in MOSS 2010 in comparison with MOSS 2007 and to increase overall stability of the module. Also the new version has an improvement for the file check out operation in Virtual Path Provider for SharePoint (VPP SP).&lt;/p&gt;
&lt;p&gt;VPP SP can be configured in two security modes: “single user” - when a special SharePoint account is used, and delegation - when CMS users connect to SharePoint with their own credentials.&lt;/p&gt;
&lt;p&gt;Single user mode configuration sample:&lt;/p&gt;
&lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; height: 159px; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;&quot;&gt;
&lt;div id=&quot;codeSnippet&quot; style=&quot;text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;
&lt;pre style=&quot;text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;&lt;span id=&quot;lnum1&quot; style=&quot;color: #606060;&quot;&gt;   1:&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;add&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;SharePointFiles&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;showInFileManager&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;true&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;bypassAccessCheck&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;false&quot;&lt;/span&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;&lt;span id=&quot;lnum2&quot; style=&quot;color: #606060;&quot;&gt;   2:&lt;/span&gt;   &lt;span style=&quot;color: #ff0000;&quot;&gt;virtualPath&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;~/SharePoint/&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;isMOSS&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;False&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;wssSiteUrl&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;http://vm-sp&quot;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;&lt;span id=&quot;lnum3&quot; style=&quot;color: #606060;&quot;&gt;   3:&lt;/span&gt;   &lt;span style=&quot;color: #ff0000;&quot;&gt;wssDomainName&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;wssLogin&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;Administrator&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;wssPassword&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;p@ss1word&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;useImpersonation&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;false&quot;&lt;/span&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;&lt;span id=&quot;lnum4&quot; style=&quot;color: #606060;&quot;&gt;   4:&lt;/span&gt;   &lt;span style=&quot;color: #ff0000;&quot;&gt;virtualName&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;SharePoint&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;customFileSummary&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;~/WSSFileSummary.config&quot;&lt;/span&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;&lt;span id=&quot;lnum5&quot; style=&quot;color: #606060;&quot;&gt;   5:&lt;/span&gt;   &lt;span style=&quot;color: #ff0000;&quot;&gt;useCache&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;True&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;cacheExpirationTime&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;30&quot;&lt;/span&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;&lt;span id=&quot;lnum6&quot; style=&quot;color: #606060;&quot;&gt;   6:&lt;/span&gt;   &lt;span style=&quot;color: #ff0000;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;EPiServer.VirtualPathWssProvider.VirtualPathWssProvider,EPiServer.VirtualPathWssProvider&quot;&lt;/span&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;&lt;span id=&quot;lnum7&quot; style=&quot;color: #606060;&quot;&gt;   7:&lt;/span&gt;   &lt;span style=&quot;color: #ff0000;&quot;&gt;wssRootFolder&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;Shared Documents&quot;&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;/&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;If VPP SP is configured in a “single user” authentication mode all users actions in EPiServer CMS file manager are executed on the SharePoint side on behalf of the user specified in VPP SP configuration (see line 3 in the sample). The main advantage of the “single user” mode is that it is much easier to configure. In most cases it works fine, except Check Out and Check In operations. In the previous version a file, checked out by any user in CMS file manager, is displayed as checked out by the user specified in VPP SP configuration:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/link/e5e04a68dccf42ba86b6fa39a7780c27.png&quot;&gt;&lt;img style=&quot;background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;&quot; title=&quot;CheckOutUser&quot; src=&quot;/link/5deef37985cd4b3f88e1c147af5fa89d.png&quot; border=&quot;0&quot; alt=&quot;CheckOutUser&quot; width=&quot;361&quot; height=&quot;235&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In the new version we implemented a better support of this operations. When user performs Check Out operation on a file in VPP SP the special record is made in EPiServer CMS database (using Dynamic Data Store). Information from this record is used to display proper value of the “Checked Out By” field and enables Check In or Cancel Check Out operations only for the user who actually checked out the file or administrators.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/link/d20eb3f7727e43fe9cff3f39ee15836e.png&quot;&gt;&lt;img style=&quot;background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;&quot; title=&quot;CheckOutUserProper&quot; src=&quot;/link/112417459ad34653b0c49f6457fb34e9.png&quot; border=&quot;0&quot; alt=&quot;CheckOutUserProper&quot; width=&quot;365&quot; height=&quot;252&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This workaround makes operations with file versions in VPP SP more convenient. However, on the SharePoint side everything looks the same as before since the files in fact, checked out in SharePoint by the user specified in VPP SP configuration. If that solution does not fit your needs you can use &lt;a href=&quot;http://world.episerver.com/Documentation/Items/Tech-Notes/EPiServer-Connect/EPiServer-Connect-for-SharePoint-22/EPiServer-Connect-24-for-Microsoft-SharePoint-2007-and-2010--Security-and-Delegation/&quot;&gt;delegation&lt;/a&gt; – in that case all file operations are executed as if the user is on SharePoint site.&lt;/p&gt;</id><updated>2011-06-07T15:23:00.0000000Z</updated><summary type="html">Blog post</summary></entry></feed>