Blog posts by Alexander Haneng
2016-06-08T14:01:53.0000000Z
/blogs/Alexander-Haneng/
Optimizely World
Episerver CMS 9 Certification Exam
/blogs/Alexander-Haneng/Dates/2016/6/episerver-cms-9-certification-exam/
2016-06-08T14:01:53.0000000Z
<p>Is it time to take your first Episerver CMS certification exam or retake an expired ECD exam? I took my first Episerver ECD exam 8 years ago on CMS 5, and have taken it several times again since then for different versions. Recently I did the new Episerver CMS 9 MVC exam online. Here are my tips for how you can prepare to take your Episerver certification exam.</p> <p> </p> <p><a href="/link/b2b5c08e59084710bba01e6516f1b288.aspx"><img title="episerver-exam-result" style="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" border="0" alt="episerver-exam-result" src="/link/cc36ef97f8bf47e3b36db010e4480288.aspx" width="700" height="464" /></a></p> <h3> </h3> <p>Read the full blog post here: <a href="http://geta.no/blogg/episerver-cms-9-certification-exam/">Episerver CMS 9 Certification Exam</a></p>
Episerver Commerce + PIM
/blogs/Alexander-Haneng/Dates/2016/5/episerver-commerce--pim/
2016-05-30T14:45:26.0000000Z
<p>When working with advanced e-commerce solutions as a developer or consultant you quickly get introduced to the acronym PIM: Product Information Management. What is it and why would you want one as part of your Episerver e-commerce project? <p> <p> <h4>Getting the product data</h4> <p>Depending on the customer you might work with tens of thousands or hundreds of thousands of individual products that you want to be available in the final e-commerce solution. Although possible, you don’t want to manually enter and update all these products in the Episerver Commerce administration interface. The products most likely already exists in the company’s ERP system, and building an integration to such a system is often an essential step of a successful Episerver Commerce project. <h4> </h4> <h4><a href="http://geta.no/blogg/episerver-commerce--pim/">Continue reading this blog post at Geta</a></h4></p></p></p></p>
Episerver Commerce vs Magento 2
/blogs/Alexander-Haneng/Dates/2015/12/episerver-commerce-vs-magento-2/
2015-12-18T09:19:59.0000000Z
<p><strong>When building a fully customized enterprise level e-commerce solution you have several platforms to choose from. Two good choices are Episerver and Magento, but how do they compare? Here is a high level look at the key differences.</strong></p> <p><strong></strong> </p> <p><strong><a href="http://geta.no/blogg/episerver-commerce-vs-magento-2/"><font size="4">Read the full blog post here: Episerver Commerce vs Magento 2</font></a></strong></p> <p><strong></strong> </p> <p><a href="http://geta.no/blogg/episerver-commerce-vs-magento-2/"><img title="Magento-2-vs-Episerver-Commerce" style="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" border="0" alt="Magento 2 vs Episerver Commerce" src="/link/7bf0a0c9bf074b7f823254a790793592.aspx" width="617" height="480" /></a></p>
The 2015 Episerver EMVP Summit
/blogs/Alexander-Haneng/Dates/2015/11/the-2015-episerver-emvp-summit/
2015-11-19T09:51:46.0000000Z
<p>Following the Episerver Ascend’15 conference in Las Vegas, the 2015 Episerver EMVP Summit was held in Zion National Park in Utah. In this blog post I will give you a little peak behind the scenes, and share with you what the EMVP program is all about.</p> <p> </p> <p><a href="http://geta.no/blogg/the-2015-episerver-emvp-summit/">Read the full blog post here: The 2015 Episerver EMVP Summit</a></p> <p> </p> <p><a href="http://geta.no/blogg/the-2015-episerver-emvp-summit/"><img title="EMVP-Summit-2015" style="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" border="0" alt="EMVP-Summit-2015" src="/link/a3a82e517113416d8e989e9feabfba4b.aspx" width="1028" height="772" /></a></p>
Moving from EPiServer CMS to EPiServer Commerce as a Developer
http://geta.no/blogg/moving-from-episerver-cms-to-episerver-commerce-as-a-developer/
2015-05-20T10:06:42.0000000Z
Are you starting your first EPiServer Commerce project? What are the major differences between the products? What new challenges do you face in an ecommerce project vs a regular website project?
EPiServer CMS 8 - What is new?
http://geta.no/blogg/episerver-cms-8---what-is-new/
2015-02-25T11:34:25.0000000Z
EPiServer has just released version 8.0 of their popular CMS/WCM system. What is new for editors? How hard is it to upgrade from 7.x? Let's take a look.
Raspberry Pi 2 hos Geta
http://geta.no/blogg/raspberry-pi-2/
2015-02-05T12:21:41.0000000Z
For tre dager siden ble den nyeste versjonen av Raspberry Pi lansert, og i dag tidlig fikk vi de første eksemplarene inn på kontoret. Hva er Raspberry Pi 2, og hvorfor er Geta interessert?
EPiServer CMS Site Performance Part 3: Optimizing images and using sprites
/blogs/Alexander-Haneng/Dates/2014/7/EPiServer-CMS-Site-Performance-Part-3-Optimizing-images-and-using-sprites/
2014-07-15T10:55:24.0000000Z
<p>In the last post we looked at bundling and minifying JavaScript and CSS files on the demo site. This time we will take a look at the image files.</p> <p><strong>Web Essentials <br /></strong>The <a href="http://vswebessentials.com/">Web Essentials extension</a> to Visual Studio is as the name says essential. If you haven’t already, you need to <a href="http://vswebessentials.com/download">download it now</a></p> <p><strong>Optimizing images <br /></strong>Most often you will find that you can make image files even smaller without decreasing the image quality. With Web Essentials installed it is simply a matter of right clicking the image(s) in Visual Studio and select “Web Essentials –> Optimize images”. </p> <p><a href="/link/d3b7c770432340d08f9dc5fed66c9b61.png"><img title="optimizepngs" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="optimizepngs" src="/link/04b72a32ea824c849836eec97faa6715.png" width="534" height="176" /></a></p> <p>The optimization shrank the file sizes between 3% to 95%. Here is one example: <br /><em>Optimized triangle.png <br />Before: 3061 bytes <br />After: 303 bytes <br />Saving: 2758 bytes / 90,1%</em></p> <p><strong>Creating sprites <br /></strong>If you look in the header area of the demo site you will see that we have five share icons, each consisting of its own small image.  </p> <p><a href="/link/c398a76d8bcb404d9372431ebccc562d.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="image" src="/link/227e7f323e864e66b2955f8dfd8eaa9f.png" width="372" height="107" /></a> </p> <div id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:9162e4f8-696d-43b7-ae00-8dec64acb454" class="wlWriterEditableSmartContent" style="float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px"><pre style=" width: 637px; height: 142px;background-color:White;overflow: auto;"><div><!--
Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/
--><span style="color: #000000;"><</span><span style="color: #000000;">ul </span><span style="color: #0000FF;">class</span><span style="color: #000000;">=</span><span style="color: #800000;">"</span><span style="color: #800000;">follow_icon</span><span style="color: #800000;">"</span><span style="color: #000000;">></span><span style="color: #000000;">
</span><span style="color: #000000;"><</span><span style="color: #000000;">li</span><span style="color: #000000;">><</span><span style="color: #000000;">a href</span><span style="color: #000000;">=</span><span style="color: #800000;">"</span><span style="color: #800000;">#</span><span style="color: #800000;">"</span><span style="color: #000000;">><</span><span style="color: #000000;">img src</span><span style="color: #000000;">=</span><span style="color: #800000;">"</span><span style="color: #800000;">/img/follow_icon1.png</span><span style="color: #800000;">"</span><span style="color: #000000;"> alt</span><span style="color: #000000;">=</span><span style="color: #800000;">""</span><span style="color: #000000;">></</span><span style="color: #000000;">a</span><span style="color: #000000;">></</span><span style="color: #000000;">li</span><span style="color: #000000;">></span><span style="color: #000000;">
</span><span style="color: #000000;"><</span><span style="color: #000000;">li</span><span style="color: #000000;">><</span><span style="color: #000000;">a href</span><span style="color: #000000;">=</span><span style="color: #800000;">"</span><span style="color: #800000;">#</span><span style="color: #800000;">"</span><span style="color: #000000;">><</span><span style="color: #000000;">img src</span><span style="color: #000000;">=</span><span style="color: #800000;">"</span><span style="color: #800000;">/img/follow_icon2.png</span><span style="color: #800000;">"</span><span style="color: #000000;"> alt</span><span style="color: #000000;">=</span><span style="color: #800000;">""</span><span style="color: #000000;">></</span><span style="color: #000000;">a</span><span style="color: #000000;">></</span><span style="color: #000000;">li</span><span style="color: #000000;">></span><span style="color: #000000;">
</span><span style="color: #000000;"><</span><span style="color: #000000;">li</span><span style="color: #000000;">><</span><span style="color: #000000;">a href</span><span style="color: #000000;">=</span><span style="color: #800000;">"</span><span style="color: #800000;">#</span><span style="color: #800000;">"</span><span style="color: #000000;">><</span><span style="color: #000000;">img src</span><span style="color: #000000;">=</span><span style="color: #800000;">"</span><span style="color: #800000;">/img/follow_icon3.png</span><span style="color: #800000;">"</span><span style="color: #000000;"> alt</span><span style="color: #000000;">=</span><span style="color: #800000;">""</span><span style="color: #000000;">></</span><span style="color: #000000;">a</span><span style="color: #000000;">></</span><span style="color: #000000;">li</span><span style="color: #000000;">></span><span style="color: #000000;">
</span><span style="color: #000000;"><</span><span style="color: #000000;">li</span><span style="color: #000000;">><</span><span style="color: #000000;">a href</span><span style="color: #000000;">=</span><span style="color: #800000;">"</span><span style="color: #800000;">#</span><span style="color: #800000;">"</span><span style="color: #000000;">><</span><span style="color: #000000;">img src</span><span style="color: #000000;">=</span><span style="color: #800000;">"</span><span style="color: #800000;">/img/follow_icon4.png</span><span style="color: #800000;">"</span><span style="color: #000000;"> alt</span><span style="color: #000000;">=</span><span style="color: #800000;">""</span><span style="color: #000000;">></</span><span style="color: #000000;">a</span><span style="color: #000000;">></</span><span style="color: #000000;">li</span><span style="color: #000000;">></span><span style="color: #000000;">
</span><span style="color: #000000;"><</span><span style="color: #000000;">li</span><span style="color: #000000;">><</span><span style="color: #000000;">a href</span><span style="color: #000000;">=</span><span style="color: #800000;">"</span><span style="color: #800000;">#</span><span style="color: #800000;">"</span><span style="color: #000000;">><</span><span style="color: #000000;">img src</span><span style="color: #000000;">=</span><span style="color: #800000;">"</span><span style="color: #800000;">/img/follow_icon5.png</span><span style="color: #800000;">"</span><span style="color: #000000;"> alt</span><span style="color: #000000;">=</span><span style="color: #800000;">""</span><span style="color: #000000;">></</span><span style="color: #000000;">a</span><span style="color: #000000;">></</span><span style="color: #000000;">li</span><span style="color: #000000;">></span><span style="color: #000000;">
</span><span style="color: #000000;"></</span><span style="color: #000000;">ul</span><span style="color: #000000;">></span></div></pre><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin. http://dunnhq.com --></div>
<p>One way to reduce the number of requests is to combine these five images into one sprite, and then use CSS to only show the part we need. To create the sprite we select the five images in Visual Studio, right click and select “Web Essentials –> Create image sprite…”.</p>
<p><a href="/link/975dc4ed016b4a1dadfefb0df30c9f92.png"><img title="createsprite" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="createsprite" src="/link/0aa6b89068be4fdbba2e4dc81d1d99a2.png" width="533" height="151" /></a> </p>
<p>This is what the sprite looks like:</p>
<p><a href="/link/befcdcad636045a692264f2baeb3c3a3.png"><img title="FollowSprite" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="FollowSprite" src="/link/f89ee92fe34a4397a40b31e1a90e2e10.png" width="24" height="120" /></a> </p>
<p>Not only will Web Essentials create a new image sprite file, but also the CSS code you need to use the sprite (as well as LESS and SASS code). All we have to do is to copy the CSS code to our style sheet and modify our HTML to use the sprite.</p>
<p><a href="/link/994a8df70b934cc4993964d08e569677.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="image" src="/link/4077a6fa74d04a3194dbf551f5ff104e.png" width="240" height="130" /></a> </p>
<div id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:4d17cbad-4857-46f2-9e0f-0dde51d3c9c8" class="wlWriterEditableSmartContent" style="float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px"><pre style=" width: 637px; height: 142px;background-color:White;overflow: auto;"><div><!--
Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/
--><span style="color: #000000;"><</span><span style="color: #000000;">ul </span><span style="color: #0000FF;">class</span><span style="color: #000000;">=</span><span style="color: #800000;">"</span><span style="color: #800000;">follow_icon</span><span style="color: #800000;">"</span><span style="color: #000000;">></span><span style="color: #000000;">
</span><span style="color: #000000;"><</span><span style="color: #000000;">li</span><span style="color: #000000;">><</span><span style="color: #000000;">a href</span><span style="color: #000000;">=</span><span style="color: #800000;">"</span><span style="color: #800000;">#</span><span style="color: #800000;">"</span><span style="color: #000000;">><</span><span style="color: #000000;">div </span><span style="color: #0000FF;">class</span><span style="color: #000000;">=</span><span style="color: #800000;">"</span><span style="color: #800000;">img-follow_icon1</span><span style="color: #800000;">"</span><span style="color: #000000;">></</span><span style="color: #000000;">div</span><span style="color: #000000;">></</span><span style="color: #000000;">a</span><span style="color: #000000;">></</span><span style="color: #000000;">li</span><span style="color: #000000;">></span><span style="color: #000000;">
</span><span style="color: #000000;"><</span><span style="color: #000000;">li</span><span style="color: #000000;">><</span><span style="color: #000000;">a href</span><span style="color: #000000;">=</span><span style="color: #800000;">"</span><span style="color: #800000;">#</span><span style="color: #800000;">"</span><span style="color: #000000;">><</span><span style="color: #000000;">div </span><span style="color: #0000FF;">class</span><span style="color: #000000;">=</span><span style="color: #800000;">"</span><span style="color: #800000;">img-follow_icon2</span><span style="color: #800000;">"</span><span style="color: #000000;">></</span><span style="color: #000000;">div</span><span style="color: #000000;">></</span><span style="color: #000000;">a</span><span style="color: #000000;">></</span><span style="color: #000000;">li</span><span style="color: #000000;">></span><span style="color: #000000;">
</span><span style="color: #000000;"><</span><span style="color: #000000;">li</span><span style="color: #000000;">><</span><span style="color: #000000;">a href</span><span style="color: #000000;">=</span><span style="color: #800000;">"</span><span style="color: #800000;">#</span><span style="color: #800000;">"</span><span style="color: #000000;">><</span><span style="color: #000000;">div </span><span style="color: #0000FF;">class</span><span style="color: #000000;">=</span><span style="color: #800000;">"</span><span style="color: #800000;">img-follow_icon3</span><span style="color: #800000;">"</span><span style="color: #000000;">></</span><span style="color: #000000;">div</span><span style="color: #000000;">></</span><span style="color: #000000;">a</span><span style="color: #000000;">></</span><span style="color: #000000;">li</span><span style="color: #000000;">></span><span style="color: #000000;">
</span><span style="color: #000000;"><</span><span style="color: #000000;">li</span><span style="color: #000000;">><</span><span style="color: #000000;">a href</span><span style="color: #000000;">=</span><span style="color: #800000;">"</span><span style="color: #800000;">#</span><span style="color: #800000;">"</span><span style="color: #000000;">><</span><span style="color: #000000;">div </span><span style="color: #0000FF;">class</span><span style="color: #000000;">=</span><span style="color: #800000;">"</span><span style="color: #800000;">img-follow_icon4</span><span style="color: #800000;">"</span><span style="color: #000000;">></</span><span style="color: #000000;">div</span><span style="color: #000000;">></</span><span style="color: #000000;">a</span><span style="color: #000000;">></</span><span style="color: #000000;">li</span><span style="color: #000000;">></span><span style="color: #000000;">
</span><span style="color: #000000;"><</span><span style="color: #000000;">li</span><span style="color: #000000;">><</span><span style="color: #000000;">a href</span><span style="color: #000000;">=</span><span style="color: #800000;">"</span><span style="color: #800000;">#</span><span style="color: #800000;">"</span><span style="color: #000000;">><</span><span style="color: #000000;">div </span><span style="color: #0000FF;">class</span><span style="color: #000000;">=</span><span style="color: #800000;">"</span><span style="color: #800000;">img-follow_icon5</span><span style="color: #800000;">"</span><span style="color: #000000;">></</span><span style="color: #000000;">div</span><span style="color: #000000;">></</span><span style="color: #000000;">a</span><span style="color: #000000;">></</span><span style="color: #000000;">li</span><span style="color: #000000;">></span><span style="color: #000000;">
</span><span style="color: #000000;"></</span><span style="color: #000000;">ul</span><span style="color: #000000;">></span></div></pre><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin. http://dunnhq.com --></div>
<p><strong>Result
<br /></strong>Lets run YSlow again and see what impact our image optimizations have had.</p>
<p><a href="/link/b3a48ce2923d4084b8b9be0b609cafac.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="image" src="/link/6be632cdd0e0400aa8d09584957d1441.png" width="352" height="176" /></a></p>
<p><em>Bytes transferred: 287.1KB down from 326.5KB (Step 1: 333.3KB)
<br />Requests: 26 down from 30 (Step 1: 35)
<br />Time: 1.09 seconds down from 1.16 seconds (Step 1: 1.27 seconds)</em></p>
EPiServer CMS Site Performance Part 2: Bundling and Minifying
/blogs/Alexander-Haneng/Dates/2014/7/EPiServer-CMS-Site-Performance-Part-2-Bundling-and-Minifying/
2014-07-15T10:44:27.0000000Z
<p>Next we will look at reducing the number of requests, reduce bytes on the wire, and leveraging browser caching for our EPiServer CMS site to increase performance.</p> <p><strong>Bundling and minifying JavaScript and CSS files <br /></strong>A good place to start to reduce the number of requests and bytes is looking at the JavaScript and CSS files we have included on every page. On our site we have 3 CSS files and 4 JavaScript files, and Google PageSpeed complains about them not being minified and having too short browser cache expiration dates set (24 hours). We can combine the CSS files into one CSS file and the JS files into one JS file, minify the combined files and set the browser cache expiration date to at least 1 year into the future. <br /> <br /></p> <div id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:0c7a1e8e-9a41-4317-b7b3-9ef98ea09855" class="wlWriterEditableSmartContent" style="float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px"><pre style=" width: 637px; height: 182px;background-color:White;overflow: auto;"><div><!--
Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/
--><span style="color: #008000;"><!--</span><span style="color: #008000;">CSS</span><span style="color: #008000;">--></span><span style="color: #000000;">
</span><span style="color: #0000FF;"><</span><span style="color: #800000;">link </span><span style="color: #FF0000;">rel</span><span style="color: #0000FF;">="stylesheet"</span><span style="color: #FF0000;"> href</span><span style="color: #0000FF;">="/css/bootstrap.css"</span><span style="color: #FF0000;"> </span><span style="color: #0000FF;">></span><span style="color: #000000;">
</span><span style="color: #0000FF;"><</span><span style="color: #800000;">link </span><span style="color: #FF0000;">rel</span><span style="color: #0000FF;">="stylesheet"</span><span style="color: #FF0000;"> href</span><span style="color: #0000FF;">="/css/style.css"</span><span style="color: #0000FF;">></span><span style="color: #000000;">
</span><span style="color: #0000FF;"><</span><span style="color: #800000;">link </span><span style="color: #FF0000;">rel</span><span style="color: #0000FF;">="stylesheet"</span><span style="color: #FF0000;"> href</span><span style="color: #0000FF;">="/css/CloudClinic.css"</span><span style="color: #0000FF;">></span><span style="color: #000000;">
</span><span style="color: #008000;"><!--</span><span style="color: #008000;">JS</span><span style="color: #008000;">--></span><span style="color: #000000;">
</span><span style="color: #0000FF;"><</span><span style="color: #800000;">script </span><span style="color: #FF0000;">src</span><span style="color: #0000FF;">="/js/jquery.js"</span><span style="color: #0000FF;">></</span><span style="color: #800000;">script</span><span style="color: #0000FF;">></span><span style="color: #000000;">
</span><span style="color: #0000FF;"><</span><span style="color: #800000;">script </span><span style="color: #FF0000;">src</span><span style="color: #0000FF;">="/js/jquery.mobilemenu.js"</span><span style="color: #0000FF;">></</span><span style="color: #800000;">script</span><span style="color: #0000FF;">></span><span style="color: #000000;">
</span><span style="color: #0000FF;"><</span><span style="color: #800000;">script </span><span style="color: #FF0000;">src</span><span style="color: #0000FF;">="/js/jquery.ui.totop.js"</span><span style="color: #0000FF;">></</span><span style="color: #800000;">script</span><span style="color: #0000FF;">></span><span style="color: #000000;">
</span><span style="color: #0000FF;"><</span><span style="color: #800000;">script </span><span style="color: #FF0000;">src</span><span style="color: #0000FF;">="/js/jquery.equalheights.js"</span><span style="color: #0000FF;">></</span><span style="color: #800000;">script</span><span style="color: #0000FF;">></span></div></pre><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin. http://dunnhq.com --></div>
<p>There are many ways to bundle and minify files using third party tools, but as of ASP.NET 4.5 it is included in the framework, so we might as well use that. Currently a default EPiServer CMS project is set to .NET version 4.0, so the first step is to set it to .NET 4.5. Right click the project in VS and select properties. Change “Target framework” to “.NET Framework 4.5” and build your project.</p>
<a href="/link/da54c7d2f4e54a9d93423ba93899b497.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="image" src="/link/a31042e5b76143cbaa22953c1b79f6e2.png" width="534" height="185" /></a>
<p>To get access to the System.Web.Optimization framework we need to install a package from nuget. Open the “Packet Manager Console” and run the following line:</p>
<div id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:523077cc-e7e2-46a2-9dbd-0adc368b5780" class="wlWriterEditableSmartContent" style="float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px"><pre style=" width: 637px; height: 50px;background-color:White;overflow: auto;"><div><!--
Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/
--><span style="color: #000000;">Install</span><span style="color: #000000;">-</span><span style="color: #000000;">Package Microsoft.AspNet.Web.Optimization</span></div></pre><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin. http://dunnhq.com --></div>
<p>Now we are all set to bundle our files.
<br />
<br /><strong>Creating the bundles
<br /></strong>If you don’t already have an “App_Start” folder in the root of your project, create it. Create a new class in this folder named “BundleConfig.cs”. In our case we have created one bundle for our JavaScript files and one bundle for our CSS files, but you can create multiple bundles.</p>
<div id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:b2795400-5442-469f-bb74-08b252586f93" class="wlWriterEditableSmartContent" style="float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px"><pre style=" width: 664px; height: 399px;background-color:White;overflow: auto;"><div><!--
Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/
--><span style="color: #0000FF;">using</span><span style="color: #000000;"> System.Web.Optimization;
</span><span style="color: #0000FF;">namespace</span><span style="color: #000000;"> CloudClinic
{
</span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">class</span><span style="color: #000000;"> BundleConfig
{
</span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">static</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> RegisterBundles(BundleCollection bundles)
{
bundles.Add(</span><span style="color: #0000FF;">new</span><span style="color: #000000;"> ScriptBundle(</span><span style="color: #800000;">"</span><span style="color: #800000;">~/Bundles/JS</span><span style="color: #800000;">"</span><span style="color: #000000;">).Include(
</span><span style="color: #800000;">"</span><span style="color: #800000;">~/js/jquery.js</span><span style="color: #800000;">"</span><span style="color: #000000;">,
</span><span style="color: #800000;">"</span><span style="color: #800000;">~/js/jquery.mobilemenu.js</span><span style="color: #800000;">"</span><span style="color: #000000;">,
</span><span style="color: #800000;">"</span><span style="color: #800000;">~/js/jquery.ui.totop.js</span><span style="color: #800000;">"</span><span style="color: #000000;">,
</span><span style="color: #800000;">"</span><span style="color: #800000;">~/js/jquery.equalheights.js</span><span style="color: #800000;">"</span><span style="color: #000000;">)
);
bundles.Add(</span><span style="color: #0000FF;">new</span><span style="color: #000000;"> StyleBundle(</span><span style="color: #800000;">"</span><span style="color: #800000;">~/Bundles/CSS</span><span style="color: #800000;">"</span><span style="color: #000000;">).Include(
</span><span style="color: #800000;">"</span><span style="color: #800000;">~/css/bootstrap.css</span><span style="color: #800000;">"</span><span style="color: #000000;">,
</span><span style="color: #800000;">"</span><span style="color: #800000;">~/css/style.css</span><span style="color: #800000;">"</span><span style="color: #000000;">,
</span><span style="color: #800000;">"</span><span style="color: #800000;">~/css/CloudClinic.css</span><span style="color: #800000;">"</span><span style="color: #000000;">)
);
}
}
}</span></div></pre><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin. http://dunnhq.com --></div>
<p><strong>Registering our bundles</strong>
<br />We need to register our bundles in the Global.asax.js file like this:</p>
<div id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:7dc4c7c5-298e-4070-b48b-d49ee718d154" class="wlWriterEditableSmartContent" style="float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px"><pre style=" width: 664px; height: 274px;background-color:White;overflow: auto;"><div><!--
Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/
--><span style="color: #0000FF;">using</span><span style="color: #000000;"> System.Web.Mvc;
</span><span style="color: #0000FF;">using</span><span style="color: #000000;"> System.Web.Optimization;
</span><span style="color: #0000FF;">namespace</span><span style="color: #000000;"> CloudClinic
{
</span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">class</span><span style="color: #000000;"> Global : EPiServer.Global
{
</span><span style="color: #0000FF;">protected</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> Application_Start()
{
AreaRegistration.RegisterAllAreas();
</span><span style="color: #008000;">//</span><span style="color: #008000;">Register JS and CSS bundles</span><span style="color: #008000;">
</span><span style="color: #000000;"> BundleConfig.RegisterBundles(BundleTable.Bundles);
}
}
}</span></div></pre><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin. http://dunnhq.com --></div>
<p><strong>Using our bundles</strong>
<br />Now we can swap our old CSS and JS files with the new bundles in our .cshtml file.</p>
<div id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:cb0552d3-584b-4a72-b8b2-fa999b707e24" class="wlWriterEditableSmartContent" style="float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px"><pre style=" width: 664px; height: 111px;background-color:White;overflow: auto;"><div><!--
Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/
--><span style="color: #000000;"><!--</span><span style="color: #000000;">CSS</span><span style="color: #000000;">--></span><span style="color: #000000;">
@Styles.Render(</span><span style="color: #800000;">"</span><span style="color: #800000;">~/Bundles/CSS</span><span style="color: #800000;">"</span><span style="color: #000000;">)
</span><span style="color: #000000;"><!--</span><span style="color: #000000;">JS</span><span style="color: #000000;">--></span><span style="color: #000000;">
@Scripts.Render(</span><span style="color: #800000;">"</span><span style="color: #800000;">~/Bundles/JS</span><span style="color: #800000;">"</span><span style="color: #000000;">)</span></div></pre><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin. http://dunnhq.com --></div>
<p>
<br /><strong>The end result
<br /></strong>By loading the page again and viewing the source we can see the end result. (Note: If you have debug=”true” in your web.config the files won’t be bundled, so make sure to set it to false first.) The files have been bundled into just two files, they have been minified, the browser cache expiration has automatically been set to 1 year into the future and by adding a version hash query string we ensure that if we make any changes to the files the browser gets the latest version.</p>
<div id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:a3c368f0-0fdd-4129-94d8-ede5510c3930" class="wlWriterEditableSmartContent" style="float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px"><pre style=" width: 691px; height: 117px;background-color:White;overflow: auto;"><div><!--
Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/
--><span style="color: #000000;"><!--</span><span style="color: #000000;">CSS</span><span style="color: #000000;">--></span><span style="color: #000000;">
</span><span style="color: #000000;"><</span><span style="color: #000000;">link href</span><span style="color: #000000;">=</span><span style="color: #800000;">"</span><span style="color: #800000;">/Bundles/CSS?v=GSQWO59HgwIEQn34xDiBFOx9GFxcmzxP29G-QcjFvn41</span><span style="color: #800000;">"</span><span style="color: #000000;"> rel</span><span style="color: #000000;">=</span><span style="color: #800000;">"</span><span style="color: #800000;">stylesheet</span><span style="color: #800000;">"</span><span style="color: #000000;">/></span><span style="color: #000000;">
</span><span style="color: #000000;"><!--</span><span style="color: #000000;">JS</span><span style="color: #000000;">--></span><span style="color: #000000;">
</span><span style="color: #000000;"><</span><span style="color: #000000;">script src</span><span style="color: #000000;">=</span><span style="color: #800000;">"</span><span style="color: #800000;">/Bundles/JS?v=pUrWyl423vnnVLCmPyX5AF4ZNMCq1q65jNhtv0FcBL41</span><span style="color: #800000;">"</span><span style="color: #000000;">></</span><span style="color: #000000;">script</span><span style="color: #000000;">></span></div></pre><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin. http://dunnhq.com --></div>
<p><a href="/link/e8853a9c995a4c1480498d4e4074a09a.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="image" src="/link/4975023dd8dd4126a7ad16333d7a9c4d.png" width="400" height="195" /></a></p>
<p><em>Bytes transferred: 326.5KB (was 333.3KB)
<br />Requests: 30 (was 35)
<br />Time: 1.16 seconds (was 1.27 seconds)</em> </p>
<p>  <br /></p>
<p><a href="http://world.episerver.com/Blogs/Alexander-Haneng/Dates/2014/7/EPiServer-CMS-Site-Performance-Part-3-Optimizing-images-and-using-sprites/">Go to Part 3: Optimizing images and using sprites</a></p>
EPiServer CMS Site Performance Part 1: Introduction
/blogs/Alexander-Haneng/Dates/2014/7/EPiServer-CMS-Site-Performance-Part-1-Introduction/
2014-07-14T13:19:52.0000000Z
<p>In this series we will look at how we can make <a href="http://world.episerver.com/Blogs/Alexander-Haneng/Dates/2014/7/Cloud-Clinic-An-EPiServer-CMS-in-Azure-demo-site/">the “Cloud Clinic” demo site</a> we built with EPiServer CMS 7.7 perform and scale better.</p> <p>In this first part we will do some base line measurements so we can see how our site perform before we do any improvements. In future posts we will try to minimize the size of the page, add caching, use Azure’s automatic scaling, add a CDN and generally anything we can do to make it faster.</p> <p><strong></strong></p> <p><strong>Our demo site: Cloud Clinic <br /></strong>In a previous post wrote about <a href="http://world.episerver.com/Blogs/Alexander-Haneng/Dates/2014/7/Cloud-Clinic-An-EPiServer-CMS-in-Azure-demo-site/">how I created the Cloud Clinic demo site</a>. It is a very small and static site (no visitors groups or user log in). However the HTML/CSS/JS came from an external source (Template Monster) and is not of the best quality (as we sometimes get in real life projects).</p> <a href="/link/9ccc9982dcd74db7aeeda9152b880986.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; margin-left: 0px; display: inline; border-top-width: 0px; margin-right: 0px" border="0" alt="image" src="/link/d825536e4cbe4c739c0e2a5a11f69437.png" width="534" height="314" /></a> <p><strong></strong></p> <p><strong>A base line measurement <br /></strong>The first thing we need is to do some base line measurements. In this case I have used YSlow for Chrome, <a href="https://developers.google.com/speed/pagespeed/insights/">Google Page Speed Insights</a> and <a href="http://loadstorm.com/">LoadStorm</a>.</p> <p><strong>Chrome and YSlow  <br /></strong>We can get a basic feeling for the size of the site (bytes on the wire), number of requests and rendering time using the built in developer tools for Chrome and the YSlow add-on. <br /></p> <p><em>Bytes transferred: 333.3KB <br />Requests: 35 <br />Time: 1.27 seconds</em>  </p> <p><a href="/link/c41975b684774791b5f23485c7bd0576.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="image" src="/link/a46c17741af0466c9b3b973f62bff322.png" width="444" height="220" /></a> </p> <p><strong>Google PageSpeed Insights</strong> <br />The PageSpeed online tool gives you two scores: one for mobile and one for desktop. The scores give you a good indication on how fast your site is. In addition you get detailed lists on what you need to improve. In our case it complained about browser caching, render-blocking JS, CSS that needs minifying and images that are not optimized. <br /><em>Mobile score: 64/100 <br />Desktop score: 77/100</em></p> <a href="/link/243c17a1a0544150a787874898563a47.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="image" src="/link/e8ff8077e75e4159bdd0156e0354cc52.png" width="534" height="363" /></a> <p><strong>Load testing with LoadStorm</strong> <br />LoadStorm is a paid cloud based load testing tool, but they also offer a free “QuickStorm” load testing service with 10 vusers over 10 minutes. <br /> <br />First I tried to run this tool with my Azure Web Site set to the free plan. After about 4 minutes it stopped responding and stayed that way for hours. Turns out the free plan only gives you a certain amount of CPU time for each interval, and when that CPU time is used up it will stop serving the site until a new interval starts. (This is also the case for shared, but with a higher CPU quota.) I flipped the switch to “Shared” and ran a new QuickStorm test.</p> <p><a href="/link/8e1a6b2eeca0496ba20d8e18cde343e6.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="image" src="/link/0a5078eab321454ca4ddc53a1738fc55.png" width="534" height="205" /></a> </p> <p>QuickStorm load tests the front page of the site starting with 1 vuser and adds another vuser very minute ending in 10 vusers for the last 2 minutes. <br /> <br />From the graph we can see that didn’t stress the site out as the average and peak response times stayed fairly even all through the test. Here are the details:</p> <a href="/link/49359536e5894ead9867972e1f74b7b2.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="image" src="/link/9a6ca6f8e6a443cd888ffb29dab0c078.png" width="353" height="240" /></a> <p><strong>Summary <br /></strong>The demo site performance isn’t terrible, but it isn’t great either. Now we have some base line measurements that we can compare with. </p> <p> <br /><a href="http://world.episerver.com/Blogs/Alexander-Haneng/Dates/2014/7/EPiServer-CMS-Site-Performance-Part-2-Bundling-and-Minifying/">Go to Part 2: Bundling and Minification</a></p>
Cloud Clinic: An EPiServer CMS in Azure demo site
/blogs/Alexander-Haneng/Dates/2014/7/Cloud-Clinic-An-EPiServer-CMS-in-Azure-demo-site/
2014-07-08T12:57:29.0000000Z
<p>To test the <a href="http://world.episerver.com/Blogs/Alexander-Haneng/Dates/2014/7/Running-EPiServer-CMS-in-Azure/">capabilities of running EPiServer CMS in Azure</a> I created a demo site called “Cloud Clinic”. It is a fictional American hospital that focuses more on making money than their patients, and as such their slogan is “Your pain, our gain” :-) In this blog post I will show you how I made it. </p> <p>You can visit the Cloud Clinic demo site at <a title="http://cloudclinic.azurewebsites.net/" href="http://cloudclinic.azurewebsites.net/">http://cloudclinic.azurewebsites.net/</a> (please note that is my playground site, so it might go up and down). You can see from the domain name that it is an Azure web site, but you can of course swap that out for your own domain name.</p> <p><a href="/link/ba2664b189394d8991259ec3bc653e27.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="image" src="/link/c87d600c0bdf4fb5abbdadd11a583891.png" width="534" height="314" /></a> </p> <p>Before we start we need a few things: <br /></p> <p>  <br /><strong>Azure account</strong> <br />We need an account and log in details for the <a href="https://manage.windowsazure.com/">Azure Management Portal</a>. Microsoft offers a free tier for Azure web sites, but you also need SQL Server, a Service Bus and BLOB storage. Through my employer I have a MSDN subscription with 300NOKs of free credits per month to use on Azure services, so check if you have one of those. <br /></p> <p><a href="/link/4dffb91d90094662a02ec896f5a47a4c.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="image" src="/link/da6a0aa9c5ff4966b6ea0ec372a67a9c.png" width="380" height="193" /></a> </p> <p> <br /><strong>EPiServer Cloud License</strong> <br />EPiServer currently offer a free “Cloud Developer License” for developers that supports 3 sites and 1000 servers. <a href="https://license.episerver.com/">Get it at the EPiServer License Center</a>, you don’t need to know the MAC or IP address, just select “Cloud” for the “Bound Input”.</p> <a href="/link/e6e64adcb80a4ddab0f09f88a9f60f06.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="image" src="/link/3ab47146013641c5819e68a80bae7e1b.png" width="524" height="203" /></a> <p><strong>Creating the site</strong> <br />The first thing I did was to create a blank EPiServer MVC project and follow <a href="http://world.episerver.com/Documentation/Items/Developers-Guide/EPiServer-CMS/75/Deployment/Deployment-scenarios/Deploying-to-Azure-websites/">the detailed instructions provided by EPiServer to make it run in Azure</a>. <br /> <br />The steps includes logging in to the Azure Management Portal and create an Azure web site, Azure storage and Azure service bus. <br /> <br /><strong>Running the site locally and in Azure</strong> <br />I wanted to be able to develop locally so I set up the site with two host names: one for localhost:xxxx and one for cloudclinic.azurewebsites.net. Note that when I run locally I use the same Azure SQL server database and Azure BLOB storage as when I run the site in Azure. To make this work you need to add a firewall exception for your machines public IP to allow it to access the Azure SQL Server externally, you can do this in the Azure Management Portal.  <br /> </p> <a href="/link/98e4f843ed56484093019478652a29c3.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="image" src="/link/4d80b10ff0984557becbef738b6569d7.png" width="534" height="334" /></a> <p>  </p> <p><strong>Activating the EPiServer license</strong> <br />The cloud developer license is not limited to MAC or IP address, all you have to do is to click the “Activate” button.</p> <p><a href="/link/4fda38dcf82e467aa599491f8fa99656.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="image" src="/link/b5525cdfcb254af1b37b40ace2dbd38a.png" width="534" height="187" /></a></p> <p><strong>Deploying code to Azure <br /></strong><a href="http://world.episerver.com/Documentation/Items/Developers-Guide/EPiServer-CMS/75/Deployment/Deployment-scenarios/Deploying-to-Azure-websites/">In step 4 of EPiServers’ guide</a> you downloaded the “Publishing Profile” from Azure that enables one click deploy from within Visual Studio. Simply right click your project in VS and select “Publish”. No more FTP or RDP into remote servers to deploy code! You can of course also set it up to use continuous deployment to Azure from your source control system. <br /></p> <p><strong>Adding some content</strong> <br />An empty EPiServer site isn’t much fun so I went the quick and dirty route and bought <a href="http://www.templatemonster.com/demo/48146.html">a template from Template Monster</a>. That gave me a responsive HTML web sites with Bootstrap, CSS, JS and images. It was fairly easy to copy & paste the HTML into my empty EPiServer MVC site and create a few page types and block types with properties to make everything editable. </p> <p><a href="/link/f136a7589f334b1f8793bf8ae664d6b4.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="image" src="/link/c4748c0ee4f747f5b4ff81650183b9a4.png" width="534" height="336" /></a></p> <p><strong>Summary</strong> <br />So now you know how easy it is to get good ol’ EPiServer CMS running in the cloud. I hope to use the “Cloud Clinic” demo site as a basis for future blog posts, so stay tuned.</p>
Running EPiServer CMS in Azure
/blogs/Alexander-Haneng/Dates/2014/7/Running-EPiServer-CMS-in-Azure/
2014-07-08T10:03:54.0000000Z
<p>As of version 7.5 you can run EPiServer CMS as an Windows Azure Web Site (WAWS), and there are good reasons to do so: cheap hosting (pay only for what you use), automatic scaling, quick and easy setup, simple to deploy new code and easy to set up (and take down) test environments.</p> <a href="/link/60023992a6024ef2b8b7086b2578bb1e.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="image" src="/link/c5bc72285ecf48f5a2ea87182fbb1323.png" width="500" height="377" /></a> <p><em>The smallest Azure Web Site plan is free. If you have a MSDN subscription you also got a monthly credit that you can use to pay for other Azure services.</em></p> <p><strong>What are Azure Web Sites?</strong> <br />The quick answer is that is a cloud based IIS instance where you can deploy your site. You don’t have to think about the OS (or patching, anti-virus, etc.) and Azure ensures that at least one instance is always running no matter what might happen to the OS host or the hardware. </p> <p><strong>What about the SQL database?</strong> <br />Azure offers an “SQL Server in the cloud” so we simply create and use that for our EPiServer database. </p> <p> <br /><strong>What about the VPP files?</strong> <br />As of version 7.5 of EPiServer CMS files are no longer stored as VPP files, but as Media (IContent). EPiServer provides an AzureBlobProvider that lets us store the Media files in Azure BLOB storage. It sounds complicated, but it is really easy. </p> <p><strong>What about event broadcasting? <br /></strong>Historically EPiServer has used event messages broadcasted on a network to notify all servers in a cluster to events (e.g. a page having been updated). In 7.5 they have added support for the Azure Service Bus to send event messages to all the servers in a cluster, so we no longer need to configure a private network between the servers.</p> <p><strong>How do I get my first site running in Azure?</strong></p> <p> <p>Getting a site up and running is fairly easy since<strong> </strong><a href="http://world.episerver.com/Documentation/Items/Developers-Guide/EPiServer-CMS/75/Deployment/Deployment-scenarios/Deploying-to-Azure-websites/">EPiServer has a very good article that will get you started.</a> <br /> <br /><a href="http://world.episerver.com/Blogs/Alexander-Haneng/Dates/2014/7/Cloud-Clinic-An-EPiServer-CMS-in-Azure-demo-site/">You can also read about how I created the “Cloud Clinic” demo site in Azure in this blog post.</a></p></p>
EPiImage is moving to the cloud in EPiServer CMS 7.5
/blogs/Alexander-Haneng/Dates/2013/8/EPiImage-is-moving-to-the-cloud-in-EPiServer-CMS-75/
2013-08-15T09:53:00.0000000Z
<p>5 years ago, when the first lines of code for EPiImage was written, the online world was very different from now, and so was EPiServer CMS. A lot has changed since version 5 including a radically new editor UI, and in the next release (7.5) we will also see <a href="http://www.epinova.no/blog/arild-henrichsen/dates/2013/6/sneak-peek-at-the-episerver-75-roadmap/">files becoming pieces of content</a> just like pages and blocks.</p> <p> </p> <p>The time has come to start fresh and look at what  EPiImage would have been if it was created from scratch today:</p> <p> </p> <h1>Speed</h1> <p>One of the big changes since 2008 is speed. We are expected to deliver more data to the end user in less time than ever, and more and more often we are suppose to do so over a slow, unreliable radio link aka a mobile network. (3G network request latency can be 1000+ms) </p> <p>Using a CDN (Content Delivery Network) has just in the last year become a must even for smaller sites, and is a cheap and efficient way to increase the speed of your site. </p> <p> </p> <p><a href="/link/f4d4cd7f65a34ac0a788dc245aeb1592.png"><img title="image" style="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" border="0" alt="image" src="/link/74ae8c257bc2428a8b412580ffe1e02f.png" width="552" height="239" /></a></p> <p align="left"><a href="http://www.internap.com/ip-and-content-delivery-network/"><em><font size="1">Image from internap</font></em></a></p> <p> </p> <h1>The cloud</h1> <p>Another change is the growth of the cloud and cloud based services. One such service that we have used with great success is <a href="http://cloudinary.com/">Cloudinary.com</a>, a service that provides image scaling and manipulation on the fly. It also has cool features like face detection based cropping!</p> <p>It is a <a href="http://cloudinary.com/pricing">paid service</a>, but they also offer a free version(500MB storage, 1GB monthly bandwidth).</p> <p> </p> <p><a href="/link/1bd3a294e23644acb3cbc61690c69d6a.png"><img title="image" style="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" border="0" alt="image" src="/link/47ce4ca9993a424aa87230292b87d8f3.png" width="621" height="220" /></a></p> <h1> </h1> <h1>New Editor UI</h1> <p>One of the main features of EPiImage for CMS 5 was the ability for editors to preview images without having to click publish first. In version 7 this functionality comes out of the box in the new UI and is no longer needed. But how do you best handle a image gallery property in the new UI? As a fly out? </p> <p> </p> <h1>Files as IContent</h1> <p>In the upcoming version of EPiServer CMS files gets some much needed love and are crowned IContent on the same level as pages and blocks. This means files now can have properties opening up many new exiting possibilities!</p> <p> </p> <h1>The way forward</h1> <p>I have started work on a brand new module that will leverage Cloudinary.com both for image transformations and CDN, and use the new file system that will come in EPiServer CMS 7.5. I will share more information as the project progresses.</p> <p>If you want to contribute or have ideas on what this new module could do, please leave a comment below.</p> <p> </p> <h1>What about EPiImage?</h1> <p>EPiImage is still available and open source. There are still a few people in the community that <a href="https://github.com/tuanvt/EPiImage-7.1">develop new features</a> and <a href="https://www.coderesort.com/p/epicode/ticket/344">fixes bugs</a>, but I will focus my efforts on this new project.</p>
The Largest EPiServer Partners Worldwide 2013
/blogs/Alexander-Haneng/Dates/2013/1/The-Biggest-EPiServer-Partners-Worldwide-2013/
2013-01-25T12:10:37.0000000Z
<p>Looking for an EPiServer partner? We take a look at the biggest EPiServer partners in the world in 2013.</p> <p> </p> <p><em>Note: This list is purely based on the number of EPiServer Certified Developers (ECDs) each partner has, as stated on their partner page on </em><a href="http://www.episerver.com/Partners/"><em>EPiServer.com</em></a><em> and updated twice a year by EPiServer. This is not a perfect measurement, but it should at least give you a relative idea of the size each company’s EPiServer department.</em></p> <p><em></em></p> <h4> </h4> <h2>The Top 10 EPiServer Partners in the World</h2> <table border="0" cellspacing="0" cellpadding="2" width="497"><tbody> <tr> <td width="60"><strong>Country:</strong></td> <td width="269"><strong>Company:</strong></td> <td width="49"><strong>ECDs:</strong></td> <td width="117"><strong>Country:</strong></td> </tr> <tr> <td width="60">1.</td> <td width="269">Making Waves</td> <td width="49">59</td> <td width="117">Norway</td> </tr> <tr> <td width="63">2.</td> <td width="264">Knowit</td> <td width="52">36</td> <td width="117">Sweden</td> </tr> <tr> <td width="65">3.</td> <td width="261">Sogeti</td> <td width="54">34</td> <td width="117">Sweden</td> </tr> <tr> <td width="66">4.</td> <td width="259">Nansen</td> <td width="56">23</td> <td width="116">Sweden</td> </tr> <tr> <td width="67">5.</td> <td width="258">Valtech</td> <td width="57">23</td> <td width="116">Sweden</td> </tr> <tr> <td width="68">6.</td> <td width="257">First Line Software</td> <td width="58">21</td> <td width="116">Russia</td> </tr> <tr> <td width="68">7.</td> <td width="256">Epinova</td> <td width="59">18</td> <td width="115">Norway</td> </tr> <tr> <td width="68">8.</td> <td width="256">Avantime</td> <td width="60">17</td> <td width="115">Sweden</td> </tr> <tr> <td width="68">8.</td> <td width="255">Logica</td> <td width="61">17</td> <td width="115">Sweden</td> </tr> <tr> <td width="68">10.</td> <td width="255">Mogul</td> <td width="62">15</td> <td width="115">Sweden</td> </tr> </tbody></table> <p> </p> <h2>Comments</h2> <p>According to the partner page there are now <strong>690</strong> developers in the world that are EPiServer certified and they work at <strong>107</strong> different partners around the world from Sweden to New Zealand. Making Waves makes another leap ahead going from 43 ECDs in 2012 to 59 while Knowit and Sogeti has the same count as last year. </p> <p> </p> <h2>The Top 10 EPiServer Countries in the World</h2> <table border="0" cellspacing="0" cellpadding="2" width="500"><tbody> <tr> <td> </td> <td><strong>Country:</strong></td> <td><strong>Total ECDs:</strong></td> </tr> <tr> <td>1.</td> <td>Sweden</td> <td>367</td> </tr> <tr> <td>2.</td> <td>Norway</td> <td>155</td> </tr> <tr> <td>3.</td> <td>United Kingdom</td> <td>49</td> </tr> <tr> <td>4.</td> <td>Netherlands</td> <td>22</td> </tr> <tr> <td>4.</td> <td>United States of America</td> <td>22</td> </tr> <tr> <td>6.</td> <td>Denmark</td> <td>21</td> </tr> <tr> <td>6.</td> <td>Russia</td> <td>21</td> </tr> <tr> <td>8.</td> <td>Finland</td> <td>13</td> </tr> <tr> <td>9.</td> <td>Poland</td> <td>7</td> </tr> <tr> <td>10.</td> <td>Serbia</td> <td>6</td> </tr> </tbody></table> <p> </p> <h2>The Top 10 EPiServer Partners in Sweden</h2> <table border="0" cellspacing="0" cellpadding="2" width="302"><tbody> <tr> <td> </td> <td width="194"><strong>Company:</strong></td> <td width="80"><strong>ECDs:</strong></td> </tr> <tr> <td>1.</td> <td width="194">Knowit</td> <td width="80">36</td> </tr> <tr> <td>2.</td> <td width="194">Sogeti</td> <td width="80">34</td> </tr> <tr> <td>3.</td> <td width="194">Nansen</td> <td width="80">23</td> </tr> <tr> <td>3.</td> <td width="194">Valtech_</td> <td width="80">23</td> </tr> <tr> <td>5.</td> <td width="194">Avantime</td> <td width="80">17</td> </tr> <tr> <td>5.</td> <td width="194">Logica</td> <td width="80">17</td> </tr> <tr> <td>7.</td> <td width="194">Mogul</td> <td width="80">15</td> </tr> <tr> <td>7.</td> <td width="194">Ottoboni</td> <td width="80">15</td> </tr> <tr> <td>9.</td> <td width="194">NetRelations</td> <td width="80">14</td> </tr> <tr> <td>10.</td> <td width="194">Creuna</td> <td width="80">13</td> </tr> </tbody></table> <p> </p> <h2>The Top 10 EPiServer Partners in Norway</h2> <table border="0" cellspacing="0" cellpadding="2" width="304"><tbody> <tr> <td> </td> <td width="202"><strong>Company:</strong></td> <td width="82"><strong>ECDs:</strong></td> </tr> <tr> <td>1.</td> <td width="202">Making Waves</td> <td width="82">59</td> </tr> <tr> <td>2.</td> <td width="202">Epinova</td> <td width="82">18</td> </tr> <tr> <td>3.</td> <td width="202">Geta AS</td> <td width="82">11</td> </tr> <tr> <td>4.</td> <td width="202">Creuna AS</td> <td width="82">10</td> </tr> <tr> <td>5.</td> <td width="202">Evry</td> <td width="82">8</td> </tr> <tr> <td>5.</td> <td width="202">Knowit</td> <td width="82">8</td> </tr> <tr> <td>5.</td> <td width="202">Bouvet AS</td> <td width="82">8</td> </tr> <tr> <td>8.</td> <td width="202">Logica</td> <td width="82">7</td> </tr> <tr> <td>9.</td> <td width="202">Sem Stenersen Prokom AS</td> <td width="82">6</td> </tr> <tr> <td>9.</td> <td width="202">IQ Data AS</td> <td width="82">6</td> </tr> </tbody></table> <p> </p> <h2>The Top 10 EPiServer Partners in UK</h2> <table border="0" cellspacing="0" cellpadding="2" width="303"><tbody> <tr> <td> </td> <td width="186"><strong>Company:</strong></td> <td width="89"><strong>ECDs:</strong></td> </tr> <tr> <td>1.</td> <td width="186">POSSIBLE</td> <td width="89">11</td> </tr> <tr> <td>2.</td> <td width="186">twentysix </td> <td width="89">7</td> </tr> <tr> <td>3.</td> <td width="186">Netcel</td> <td width="89">5</td> </tr> <tr> <td>3.</td> <td width="186">WTG</td> <td width="89">5</td> </tr> <tr> <td>5.</td> <td width="186">Auros</td> <td width="89">4</td> </tr> <tr> <td>5.</td> <td width="186">Ultimedia Ltd</td> <td width="89">4</td> </tr> <tr> <td>5.</td> <td width="186">Cubeworks</td> <td width="89">4</td> </tr> <tr> <td>8.</td> <td width="186">Emperor Design</td> <td width="89">3</td> </tr> <tr> <td>9.</td> <td width="186">eibDIGITAL</td> <td width="89">2</td> </tr> <tr> <td>10.</td> <td width="186">CDS</td> <td width="89">1</td> </tr> </tbody></table> <p> </p> <h2>The Top 5 EPiServer Partners in the USA</h2> <table border="0" cellspacing="0" cellpadding="2" width="302"><tbody> <tr> <td> </td> <td width="195"><strong>Company:</strong></td> <td width="87"><strong>ECDs:</strong></td> </tr> <tr> <td>1.</td> <td width="195">Nansen</td> <td width="87">6</td> </tr> <tr> <td>2.</td> <td width="195">Adage Technologies</td> <td width="87">5</td> </tr> <tr> <td>3.</td> <td width="195">agencyQ</td> <td width="87">4</td> </tr> <tr> <td>4.</td> <td width="195">twentysix </td> <td width="87">4</td> </tr> <tr> <td>5.</td> <td width="195">Blend Interactive, Inc</td> <td width="87">2</td> </tr> </tbody></table>
Getting EPiServer 6 custom properties to work in EPiServer 7: Cannot create and populate list type…
/blogs/Alexander-Haneng/Dates/2013/1/Getting-EPiServer-6-custom-properties-to-work-in-EPiServer-7-Cannot-create-and-populate-list-type/
2013-01-23T13:08:15.0000000Z
<p>When working on getting EPiImage to work in EPiServer 7 I ran into the following error when publishing or auto saving an EPiImageGalleryProperty.</p> <p> </p> <p><a href="/link/d0178d71fb324c308fdb4b8794dbe5d8.jpg"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image002" border="0" alt="clip_image002" src="/link/dbb30712eb62411e9167a19d4a1f9718.jpg" width="620" height="248" /></a></p> <p> </p> <p>From the error message I guessed it had something to do with the JSON communication used in the new UI.</p> <p> </p> <p>Turns out that since EPiImageGalleryProperty stores its data as an EPiImageGalleryImageCollection object, EPiServer 7 doesn’t know how to serialize it as a JSON object. But how can we tell EPiServer explicitly how to do the serialization?</p> <p> </p> <p>Luckily Linus Ekström (EPiServer Sweden) helped me out with some sample code:</p> <div id="codeSnippetWrapper"> <div style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"> <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #0000ff">using</span> System;</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #0000ff">using</span> EPiServer.ServiceLocation;</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #0000ff">using</span> Newtonsoft.Json;</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #0000ff">namespace</span> EPiServer.Cms.Shell.Json</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">{</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #008000">/// <summary></span></pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #008000">/// Json converter thas handles conversion between </span></pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #008000">/// <see cref="Url"/> and <see cref="string"/>.</span></pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #008000">/// </summary></span></pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> [ServiceConfiguration(<span style="color: #0000ff">typeof</span>(JsonConverter))]</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #0000ff">public</span> <span style="color: #0000ff">class</span> UrlConverter : JsonConverter</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> {</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #0000ff">public</span> <span style="color: #0000ff">override</span> <span style="color: #0000ff">bool</span> CanConvert(Type objectType)</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> {</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #0000ff">return</span> <span style="color: #0000ff">typeof</span>(Url).IsAssignableFrom(objectType);</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> }</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #0000ff">public</span> <span style="color: #0000ff">override</span> <span style="color: #0000ff">object</span> ReadJson(</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> JsonReader reader, </pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> Type objectType, </pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #0000ff">object</span> existingValue, </pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> JsonSerializer serializer)</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> {</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #0000ff">return</span> (reader.Value == <span style="color: #0000ff">null</span>) ? <span style="color: #0000ff">null</span> : </pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #0000ff">new</span> Url(reader.Value.ToString());</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> }</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #0000ff">public</span> <span style="color: #0000ff">override</span> <span style="color: #0000ff">void</span> WriteJson(</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> JsonWriter writer, </pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #0000ff">object</span> <span style="color: #0000ff">value</span>, </pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> JsonSerializer serializer)</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> {</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> var url = <span style="color: #0000ff">value</span> <span style="color: #0000ff">as</span> Url;</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #0000ff">if</span> (url == <span style="color: #0000ff">null</span> || url.IsEmpty())</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> {</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> writer.WriteValue(<span style="color: #0000ff">string</span>.Empty);</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #0000ff">return</span>;</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> }</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> writer.WriteValue(<span style="color: #0000ff">value</span>.ToString());</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> }</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> }</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">}</pre>
<!--CRLF--></div>
</div>
<p> </p>
<p>This class which inherits from JsonConverter tells EPiServer 7 how to do the conversion of a EPiServer.Url to Json (meaning a string representation) and back again.</p>
<p> </p>
<p>I can create my own Json converter for EPiImageGalleryImageCollection like this:</p>
<div id="codeSnippetWrapper">
<div style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #0000ff">using</span> System;</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #0000ff">using</span> EPiServer.ServiceLocation;</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #0000ff">using</span> Newtonsoft.Json;</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #0000ff">namespace</span> MakingWaves.EPiImage.EPiImage.Code</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">{</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #008000">/// <summary></span></pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #008000">/// Json converter that handles conversion between </span></pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #008000">/// EPiImageGalleryImageCollectionConverter </span></pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #008000">/// and string for the new EPiServer 7 UI</span></pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #008000">/// </summary></span></pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> [ServiceConfiguration(<span style="color: #0000ff">typeof</span>(JsonConverter))]</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #0000ff">public</span> <span style="color: #0000ff">class</span> EPiImageGalleryImageCollectionJsonConverter : JsonConverter</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> {</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #0000ff">public</span> <span style="color: #0000ff">override</span> <span style="color: #0000ff">bool</span> CanConvert(Type objectType)</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> {</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #0000ff">return</span> <span style="color: #0000ff">typeof</span>(EPiImageGalleryImageCollection).IsAssignableFrom(objectType);</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> }</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #0000ff">public</span> <span style="color: #0000ff">override</span> <span style="color: #0000ff">object</span> ReadJson(</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> JsonReader reader, </pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> Type objectType, </pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #0000ff">object</span> existingValue, </pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> JsonSerializer serializer)</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> {</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #0000ff">if</span> (reader.Value == <span style="color: #0000ff">null</span>)</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #0000ff">return</span> <span style="color: #0000ff">null</span>;</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #0000ff">return</span> <span style="color: #0000ff">new</span> EPiImageGalleryImageCollection(reader.Value.ToString());</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> }</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #0000ff">public</span> <span style="color: #0000ff">override</span> <span style="color: #0000ff">void</span> WriteJson(</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> JsonWriter writer, </pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #0000ff">object</span> <span style="color: #0000ff">value</span>, </pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> JsonSerializer serializer)</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> {</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> EPiImageGalleryImageCollection gallery = <span style="color: #0000ff">value</span> </pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #0000ff">as</span> EPiImageGalleryImageCollection;</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #0000ff">if</span> (gallery == <span style="color: #0000ff">null</span> || gallery.Count == 0)</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> {</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> writer.WriteValue(<span style="color: #0000ff">string</span>.Empty);</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #0000ff">return</span>;</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> }</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> writer.WriteValue(gallery.ToString());</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> }</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> }</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">}</pre>
<!--CRLF--></div>
</div>
<p> </p>
<p>For it to work I also needed to do the following changes to my existing EPiImage code:</p>
<p>1. Create a ToString method for EPiImageGalleryImageCollection that accurately serialized the data in the object to a string. As it consists of a List<EPiImageGalleryImage> I also need to: </p>
<p>2. Create a ToString method for EPiImageGalleryImage that accurately serialized the data in the object to a string</p>
<p>3. Create a constructor method for EPiImageGalleryImageCollection that could take in the serialized string as a parameter to recreate the object</p>
<p>4. Create a constructor method for EPiImageGalleryImage that could take in the serialized string as a parameter to recreate the object</p>
<p> </p>
<p>If you are converting your own custom property to work with EPiServer 7, I thought this code might guide you in the right direction <img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="/link/75d78dd3751843e7bdcb7d2f0696cd73.png" /></p>
EPiImage for EPiServer 7: Legacy release
/blogs/Alexander-Haneng/Dates/2013/1/EPiImage-for-EPiServer-7-Legacy-release/
2013-01-23T11:22:30.0000000Z
<p>If you are upgrading an EPiServer CMS 6 site to EPiServer CMS 7 and you are using EPiImage, you can now download a version of EPiImage that works with EPiServer 7.</p> <p> </p> <h2>Word of warning!</h2> <p><font color="#ff0000"><strong>Currently this version of EPiImage is strictly a “works on my machine” release! No promises made!</strong></font></p> <p>Also there are some small issues that needs to be worked out. See the section “Know issues” later in this blog post for details.</p> <p><a href="https://www.coderesort.com/p/epicode/browser/MakingWaves.EPiImage/7.x">The full source code is available here</a>, so if you run into any issues you can try to fix them yourself. Just remember to commit any fixes back to the community!</p> <p> </p> <h2>Legacy </h2> <p>This version is not meant for a new site based on EPiServer 7, but for people upgrading an existing EPiServer CMS 6 site that uses EPiImage. The reason is that this version does not take advantage of all the new UI features, but simply make it work using EPiServer legacy features. </p> <p> </p> <h2>The legacy mode in EPiServer 7 new UI</h2> <p>Below you can see how the EPiImage properties behaves in the new edit UI:</p> <p><a href="/link/2c3bf25edc1b4de299dfd55360b585a6.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="/link/b714e49a9f81470e8593b070873708f8.png" width="544" height="322" /></a></p> <p><em>A page showing an EPiImageProperty and an EPiImageGalleryProperty in the new edit mode.</em></p> <p> </p> <p><a href="/link/58b5c96e64c44e0cb7bb272a0251656f.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="/link/575872cae80e4daf860fe777ca7d391a.png" width="467" height="175" /></a></p> <p><em>If you use the <EPiServer:Property runat="server" PropertyName="EPiImage" /> to show the EPiImageProperty the image will be clickable.</em></p> <p> </p> <p><a href="/link/5a966a6bb7f546a4a6bab21b1cbf2485.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="/link/2cd203032450429baafa8c3fcaa58373.png" width="371" height="281" /></a></p> <p><em>When you click the EPiImageProperty image you get a dialog box where you can edit the image.</em></p> <p><em></em></p> <p><em></em></p> <p><a href="/link/b4e15df51b854cdaa10fc512836d64e9.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="/link/62499d55a3fa41e2ad5e1e4545577e76.png" width="395" height="86" /></a></p> <p><em>EPiImageGallery does not have a EPiServer:Property template, so you will have to go to forms mode to edit it.</em></p> <h2> </h2> <p> </p> <p><a href="/link/89d3e5077d804d29b79bf8b1cccd08cf.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="/link/3487826b76104b64a8198d5a7d4bdff9.png" width="443" height="255" /></a></p> <p><em>Clicking the “…” button will open the property in a dialog box where you can edit the gallery. Note: You can not drag and drop files from the file manager in this mode (you need to use classic mode).</em></p> <h2> </h2> <h2> </h2> <h2> </h2> <h2>The “classic” edit mode in EPiServer 7</h2> <p>If you run your site in the “classic” edit mode, then the properties works the same as in EPiServer CMS 6.</p> <p><a href="/link/8fbfe75ed486450798951c2b512d44f4.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="/link/b1aef1537d28442a8643de2ca98e20cf.png" width="617" height="414" /></a></p> <h2> </h2> <p> </p> <h2>Known issues</h2> <p>There are a few known issues:</p> <p>1. You can’t drag and drop files from the file manager into galleries in the new UI.</p> <p>2. The preview window is not fully displayed in the legacy mode.</p> <p><a href="/link/d8bc7af1ce70428cadb90a5ced1cad60.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="/link/f6ab5e8d9cd64d839fe98d639dad7d8c.png" width="363" height="209" /></a></p> <p>If you find any more, please leave them in the comments.</p> <p> </p> <h2>Thanks to</h2> <p>Steve Celius (EPiServer Norway) has done most of the work to get this version together, so send him some happy thoughts <img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="/link/bd3e1afb406e489788158cf2168c855a.png" /> Also Linus Ekström (EPiServer Sweden) provided the key sample code to get the JSON serialization working: Thanks!</p> <p> </p> <h2>Download</h2> <p>Get the module from <a href="http://nuget.episerver.com">nuget.episerver.com</a> or <a href="https://www.coderesort.com/p/epicode/raw-attachment/wiki/EPiImage/MakingWaves.EPiImage.LegacyEPi7.7.0.0.10.nupkg">download it here</a>.</p>
5 Secrets in EPiServer CMS 7 Edit Mode
/blogs/Alexander-Haneng/Dates/2013/1/5-Secrets-in-EPiServer-CMS-7-Edit-Mode/
2013-01-18T16:10:34.0000000Z
<p>In this blog post I will show you 5 secrets you (maybe) didn’t know about in EPiServer 7 CMS edit mode.</p> <p> </p> <h1>Secret #1: Get the old edit mode back!</h1> <p>Even with all the flashiness of the new on page edit UI and the availability of forms editing, some people still long back to the good old EPiServer edit mode.</p> <p> </p> <p><font color="#ff0000">Secret #1:</font> EPiServer 7 CMS still has it!</p> <p> </p> <p>All you need to do is to modify the normal edit path:</p> <p><a title="http://episerver7/secureui/Cms/#context=epi.cms.contentdata:///4" href="http://episerver7/{ui}/Cms/#context=epi.cms.contentdata:///4">http://episerver7/{ui}/Cms/#context=epi.cms.contentdata:///4</a></p> <p>to:</p> <p><a title="http://episerver7/secureui/Cms/#context=epi.cms.contentdata:///4" href="http://episerver7/{ui}/Cms/edit/">http://episerver7/{ui}/Cms/edit/</a></p> <p> </p> <p><a href="/link/0466f6ca7ac34b929ca09fe8b5293703.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="/link/f1d2d6deb491442bb73cbba4aa263f3f.png" width="596" height="340" /></a></p> <p><em>The old EPiServer edit mode still exists in EPiServer 7 CMS</em></p> <p> </p> <p>It is even possible to set the old edit mode as the default. </p> <p> </p> <p>Note that you can’t work with blocks and content areas in this mode:</p> <p><a href="/link/ff18e5067392449283fdd87f12a91954.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="/link/c5e1924223ef43ee91944687b6f8f43c.png" width="515" height="172" /></a></p> <p> </p> <p><em>Note: The reason it still exists is for legacy support, so don’t expect it to survive the next big EPiServer update</em>. </p> <p> </p> <p> </p> <h1>Secret #2: Show forms editing and a preview at the same time!</h1> <p>If you prefer working with pages in the “forms editing” mode, you loose the page preview you get in “on page edit” mode. </p> <p> </p> <p><font color="#ff0000">Secret #2:</font> You can get a preview in “forms editing” mode by dragging the left side.</p> <p> </p> <p><a href="/link/b7b98ace9ca949819583b66fa75b55f4.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="/link/0319e4949eac47a191ce1ff45119bad9.png" width="377" height="551" /></a></p> <p><em>Move your cursor to the left edge of the window in “forms edit” mode until it turns into a double arrow. Drag the edge to the right to show the preview.</em></p> <p> </p> <p><a href="/link/7e2b8fc12d1543b9a0c9a35959a32237.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="/link/43303e8dd5544b4ba0de76497a573de9.png" width="612" height="352" /></a></p> <p><em>After you have dragged the edge to the right you see both the forms edit mode and a preview at the same time. Works best on a large screen.</em></p> <h2> </h2> <p> </p> <h1>Secret #3: Email a colleague a link to exactly what you see in edit mode!</h1> <p>You are editing the “Reporting Made Simple” page when you see that something looks funny when viewed in the mobile channel using the iPad horizontal resolution. You want to consult with a colleague and email instructions on how to get to the page, ask her to turn on the right channel and resolution for her to see what you see. </p> <p><strong></strong></p> <p><font color="#ff0000">Secret #3:</font><strong> </strong>You can copy and past the URL into an email to your colleague for her to see exactly what you see! Including the exact page, the exact version you are working on (main draft), channel and resolution.</p> <p> </p> <p>Here is an example URL:</p> <p><a title="http://episerver7/secureui/Cms/#context=epi.cms.contentdata:///18&viewsetting=active:///true|resolution:///1024x768|epichannel:///Mobile" href="http://episerver7/secureui/Cms/#context=epi.cms.contentdata:///18&viewsetting=active:///true|resolution:///1024x768|epichannel:///Mobile">http://episerver7/secureui/Cms/#context=epi.cms.contentdata:///18& <br />viewsetting=active:///true|resolution:///1024x768|epichannel:///Mobile</a></p> <p> </p> <p><a href="/link/5f8bfd98805e4a7eae974a3026db3409.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="/link/1705d975d31443329b97d75b074384d3.png" width="605" height="416" /></a></p> <p><em>1. Copy the URL from the address bar</em></p> <p> </p> <p><a href="/link/4ee6ab33e9524d12889dd7f3ba6c4b4f.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="/link/42665158f23e459ea8bcc2a060b31b7c.png" width="605" height="388" /></a></p> <p><em>2. Email the URL to your colleague</em></p> <br /> <br /> <p><a href="/link/f823d690dd4348f3b4ba3e3551a5c54b.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="/link/c2f4808d3877491d9892f7c807e846d5.png" width="609" height="424" /></a></p> <p><em>3. When your colleague clicks the link she will see the exact same page as you!</em></p> <p><em></em></p> <p><em>Note: This currently doesn’t work in Internet Explorer 9.</em></p> <p><em></em></p> <p><em></em></p> <h2> </h2> <h1>Secret #4: See a list of versions of a page (or a block)</h1> <p>To see the list of page or block versions you need to add a gadget to the “assets pane” (on the right).</p> <p> </p> <p><font color="#ff0000">Secret #4:</font> Add the “Versions” gadget to the assets pane to view the page version list.</p> <p> </p> <p><a href="/link/f33426e9e4194e3b89d93779ae9d3663.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="/link/b615130589b84b1d91976182556ada13.png" width="462" height="156" /></a></p> <p><em>Step 1: Click the gear button on the top of the “assets pane” and select “Add Gadget”</em></p> <p> </p> <p><a href="/link/d506409236dd4ea288b1651d57c5291d.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="/link/f4a9acc672a84158bc35f5ee43b2881e.png" width="508" height="356" /></a></p> <p><em>Step 2: Click the + next to the “Versions” gadget. Nothing happens, but don’t worry. The gadget has been added. Click “Done”. <br /></em></p> <br /> <br /> <p><a href="/link/50d6dde691864c7fa8756b72ad35286c.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="/link/8b9cbe97585f45479542738b307ee706.png" width="430" height="441" /></a></p> <p><em>The gadget shows all the versions of the page or block you are working on.</em></p> <br /> <br /> <p><font color="#ff0000">Bonus tip:</font> To remove a gadget you need to select “Rearrange Gadgets” and then click the X on the gadget.</p> <p> </p> <p><a href="/link/22b598d1761644fe94eca1ea3b9cd554.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="/link/04a26d051db049c890778ce514de3e0d.png" width="351" height="158" /></a></p> <p><em>Select “Rearrange gadgets”</em></p> <br /> <br /> <p><a href="/link/7b828e12f548457ebe4c902e04ee455b.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="/link/7bfb3169beda4b09b502b7d0dc287a21.png" width="359" height="187" /></a></p> <p><em>Click the X to remove the gadget.</em></p> <p><em></em></p> <p><em></em></p> <h2> </h2> <h1>Secret #5: There is a trash can for pages and blocks</h1> <p>In earlier versions of EPiServer CMS the “recycle bin” was prominently shown in the page tree. In EPiServer 7 the button for the “trash” can is so hidden it (almost) qualifies as a secret.</p> <p> </p> <p><font color="#ff0000">Secret #5:</font> Click the gear button at the bottom of the page tree and click “View Trash” to see the trash can for pages and blocks.</p> <p> </p> <p><a href="/link/f8caee55e7b24024a86eca7573431759.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="/link/71768107263c4c7387defd3fcb3362fe.png" width="433" height="222" /></a></p> <p> </p> <p><a href="/link/61347fbb844344e9af5f8c7e7c3e6b70.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="/link/01fd56788213432fa2b845ab19e7ec36.png" width="609" height="340" /></a></p> <p><em>In the Trash you can see deleted pages and blocks.</em></p> <p><em></em></p> <p><em></em></p> <h2> </h2> <h1>Final thoughts</h1> <p>I hope showing you these “secrets” makes you editorial job a little easier in EPiServer 7 <img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="/link/6d8199bf5edd4481880dce3c5e59ad9a.png" /></p>
Limiting a Page Property to a specific Page Type in EPiServer 7
/blogs/Alexander-Haneng/Dates/2013/1/Limiting-a-Page-Property-to-a-specific-Page-Type-in-EPiServer-7/
2013-01-16T13:31:14.0000000Z
<p>In EPiServer 7 you can limit what page types can be selected in a page or link collection property using validation attributes.</p> <p> </p> <h2>Intro</h2> <p>One of the big problems with EPiServer sites that have lived a while is when some clever editor decides to change a page property. It just so happens that this specific page property is used to get a page of a specific page type that contains some important properties that are used for settings/header/footer/search page etc. For example a page property on the start page that links to a settings page gets changed to an article page. This might result in the whole site crashing. Arghhh…</p> <p> </p> <h2>Limiting page types for a page property</h2> <p>In EPiServer 7 we get to create our own validation attributes, so why not create a validation attribute that prevents the user from selecting the wrong page type?</p> <p>I have created such an validation attribute. <strong>Simply add this class to your project and you can start using it.</strong> You can find the source code at the end of this article</p> <p> </p> <h2>Using the [LimitPageType] attribute to limit a page property to a specific page type</h2> <p>Lets say we have a settings page in our solution and we have a page property that points to the search page for our site. We want to ensure that only a page of the page type “SearchPage” can be selected.</p> <p> </p> <div id="codeSnippetWrapper"> <div style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"> <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><font style="background-color: #ffff00">[LimitPageType(<span style="color: #0000ff">typeof</span>(SearchPage),</font></pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <font style="background-color: #ffff00">ErrorMessage = <span style="color: #006080">"Page '{2}' is not of page type '{1}'! "</span> +</font></pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <font style="background-color: #ffff00"><span style="color: #006080">"(It is of the type '{3}')"</span>)]</font></pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">[Display(</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">Name = <span style="color: #006080">"Search page"</span>,</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">Description = <span style="color: #006080">""</span>,</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">GroupName = SystemTabNames.Content,</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">Order = 1)]</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #0000ff">public</span> <span style="color: #0000ff">virtual</span> PageReference SearchPage { get; set; }</pre>
<!--CRLF--></div>
</div>
<p> </p>
<p>If we try to select the page “Management” of type “StandardPage” we will get the following error:</p>
<p><a href="/link/241bce4f747b44e6a1083cf75abee2af.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="/link/a108254f74894666b751e15850ad88fa.png" width="608" height="147" /></a></p>
<p> </p>
<h2>Using inheritance</h2>
<p>You can also use inheritance, so if you limit the page property to “StandardPage” you can select a page of the type of “StandardPage” or any page inherited from “StandardPage” like “NewsPage” and “ProductPage”.</p>
<p> </p>
<div id="codeSnippetWrapper">
<div style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">[LimitPageType(<span style="color: #0000ff">typeof</span>(<font style="background-color: #ffff00">StandardPage</font>),</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> ErrorMessage = <span style="color: #006080">"Page '{2}' is not of page type '{1}'! "</span> +</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #006080">"(It is of the type '{3}')"</span>)]</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">[Display(</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">Name = <span style="color: #006080">"About us page"</span>,</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">Description = <span style="color: #006080">""</span>,</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">GroupName = SystemTabNames.Content,</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">Order = 2)]</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #0000ff">public</span> <span style="color: #0000ff">virtual</span> PageReference AboutUsPage { get; set; }</pre>
<!--CRLF--></div>
</div>
<p> </p>
<h2>Using the [LimitPageType] attribute to limit a page property to an interface </h2>
<p>You are not limited to page types, you can also specify an interface to only allow page types that implements a specific interface to be selectable. This ensures that the properties defined in the interface will be included in the selected page.</p>
<p> </p>
<div id="codeSnippetWrapper">
<div style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">[LimitPageType(<span style="color: #0000ff">typeof</span>(<font style="background-color: #ffff00">ISearchable</font>),</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> ErrorMessage = <span style="color: #006080">"Page '{2}' is not of type '{1}'!"</span>)]</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">[Display(</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">Name = <span style="color: #006080">"Searchable page page"</span>,</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">Description = <span style="color: #006080">""</span>,</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">GroupName = SystemTabNames.Content,</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">Order = 3)]</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #0000ff">public</span> <span style="color: #0000ff">virtual</span> PageReference SearchablePage { get; set; }</pre>
<!--CRLF--></div>
</div>
<p> </p>
<p> </p>
<h2>Using the [LimitPageType] attribute to limit a Link Item Collection property to only contain pages of a specific page type</h2>
<p>The validation attribute also works on the <em>LinkItemCollection</em> property and it checks that all the items are EPiServer pages of the correct page type. In this example we only want to have a list of contact pages of the type “Contactpage”.</p>
<p> </p>
<div id="codeSnippetWrapper">
<div style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">[LimitPageType(<span style="color: #0000ff">typeof</span>(ContactPage),</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> ErrorMessage = <span style="color: #006080">"Link '{2}' is not a page of type '{1}'!"</span>)]</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">[Display(</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">Name = <span style="color: #006080">"Contacts"</span>,</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">Description = <span style="color: #006080">""</span>,</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">GroupName = SystemTabNames.Content,</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">Order = 4)]</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #0000ff">public</span> <span style="color: #0000ff">virtual</span> <font style="background-color: #ffff00">LinkItemCollection</font> Contacts { get; set; }</pre>
<!--CRLF--></div>
</div>
<p> </p>
<p> </p>
<p><a href="/link/ee93f13cdddc40d3a8e13bf244a0dda1.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="/link/3e3b5d0fa4d94641bce7353aed0367f7.png" width="499" height="376" /></a></p>
<p> </p>
<p><a href="/link/226cf03540e94f33bc5cfb0e1fcf3c46.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="/link/f6be25a875974572bd80b8412dd3aeb9.png" width="613" height="146" /></a></p>
<p> </p>
<h2>Summing up</h2>
<h2></h2>
<p>The <a href="http://world.episerver.com/Blogs/Alexander-Haneng/Dates/2012/7/How-to-define-properties-in-EPiServer-7---A-quick-reference/">built in validation attributes like StringLength, Range and RegularExpression</a> are really powerful in validating the input from editors, especially when you need to use it for something more than just displaying the value. This power can be further extended with custom validation attributes like the one in this blog post. I am sure more validators will be released by the community as EPiServer 7 matures.</p>
<p> </p>
<h2>Source code: LimitPageType.cs</h2>
<p>For the examples in the blog post to work you need to create an empty class in your project and copy and paste the code below inside.</p>
<p> </p>
<div id="codeSnippetWrapper">
<div style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #0000ff">using</span> System;</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #0000ff">using</span> System.Collections.Generic;</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #0000ff">using</span> System.Globalization;</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #0000ff">using</span> System.ComponentModel.DataAnnotations;</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #0000ff">using</span> EPiServer.Core;</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #0000ff">using</span> EPiServer.SpecializedProperties;</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #0000ff">using</span> EPiServer.Web;</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #0000ff">namespace</span> EPiServer.Templates.Alloy.Validation</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">{</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #008000">/// <summary></span></pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #008000">/// LimitPageType Validation Attribute</span></pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #008000">/// Add the attribute [LimitPageType(typeof(StandardPage))] to a EPiServer </span></pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #008000">/// PageReference property to limit what pages can be selected to the </span></pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #008000">/// chosen page type. Can also be used for inherited page types and </span></pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #008000">/// interfaces.</span></pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #008000">/// </summary></span></pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, </pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> AllowMultiple = <span style="color: #0000ff">false</span>)]</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #0000ff">public</span> <span style="color: #0000ff">sealed</span> <span style="color: #0000ff">class</span> LimitPageType : ValidationAttribute</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> {</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #0000ff">private</span> <span style="color: #0000ff">readonly</span> Type _pageType;</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #0000ff">private</span> <span style="color: #0000ff">string</span> _errorMsg = <span style="color: #0000ff">string</span>.Empty;</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #0000ff">public</span> Type PageType { get { <span style="color: #0000ff">return</span> _pageType; } }</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #0000ff">public</span> LimitPageType(Type PageType)</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> {</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> _pageType = PageType;</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> }</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #0000ff">public</span> <span style="color: #0000ff">override</span> <span style="color: #0000ff">bool</span> IsValid(<span style="color: #0000ff">object</span> <span style="color: #0000ff">value</span>)</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> {</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #008000">// Check if page reference is a reference to a page of </span></pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #008000">// the right page type</span></pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> PageReference pageRef = <span style="color: #0000ff">value</span> <span style="color: #0000ff">as</span> PageReference;</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #0000ff">if</span> (pageRef != <span style="color: #0000ff">null</span>)</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> {</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> PageData page = DataFactory.Instance.GetPage(pageRef);</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> _errorMsg = page.PageTypeName;</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #0000ff">if</span> (!<span style="color: #0000ff">this</span>.PageType.IsInstanceOfType(page))</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #0000ff">return</span> <span style="color: #0000ff">false</span>;</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> }</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #0000ff">else</span> <span style="color: #0000ff">if</span> (<span style="color: #0000ff">value</span> <span style="color: #0000ff">as</span> LinkItemCollection != <span style="color: #0000ff">null</span>)</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> {</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #008000">//Loop through and check if it is a link to an EPiServer page. </span></pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #008000">//If it is add it to pages.</span></pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> LinkItemCollection linkItems = <span style="color: #0000ff">value</span> <span style="color: #0000ff">as</span> LinkItemCollection;</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> List<PageData> pages = <span style="color: #0000ff">new</span> List<PageData>();</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #0000ff">foreach</span> (LinkItem linkItem <span style="color: #0000ff">in</span> linkItems)</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> {</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #0000ff">string</span> linkUrl;</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #0000ff">if</span> (!PermanentLinkMapStore.TryToMapped(linkItem.Href, </pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #0000ff">out</span> linkUrl))</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> {</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> _errorMsg = linkItem.Text;</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #0000ff">return</span> <span style="color: #0000ff">false</span>;</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> }</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #0000ff">if</span> (<span style="color: #0000ff">string</span>.IsNullOrEmpty(linkUrl))</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> {</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> _errorMsg = linkItem.Text;</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #0000ff">return</span> <span style="color: #0000ff">false</span>;</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> }</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> PageReference pageReference = PageReference.ParseUrl(linkUrl);</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #0000ff">if</span> (PageReference.IsNullOrEmpty(pageReference))</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> {</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> _errorMsg = linkItem.Text;</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #0000ff">return</span> <span style="color: #0000ff">false</span>;</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> }</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> pages.Add(DataFactory.Instance.GetPage((pageReference)));</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> }</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #0000ff">if</span> (pages.Count > 0)</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> {</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #0000ff">foreach</span> (PageData page <span style="color: #0000ff">in</span> pages)</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> {</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #0000ff">if</span> (!<span style="color: #0000ff">this</span>.PageType.IsInstanceOfType(page))</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> {</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> _errorMsg = page.PageName;</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #0000ff">return</span> <span style="color: #0000ff">false</span>;</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> }</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> }</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> }</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #0000ff">return</span> <span style="color: #0000ff">true</span>;</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> }</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #0000ff">return</span> <span style="color: #0000ff">true</span>;</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> }</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #0000ff">public</span> <span style="color: #0000ff">override</span> <span style="color: #0000ff">string</span> FormatErrorMessage(<span style="color: #0000ff">string</span> name)</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> {</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> <span style="color: #0000ff">return</span> String.Format(CultureInfo.CurrentCulture,</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> ErrorMessageString, name, <span style="color: #0000ff">this</span>.PageType.Name, _errorMsg);</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> }</pre>
<!--CRLF-->
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> }</pre>
<!--CRLF-->
<pre style="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: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">}</pre>
<!--CRLF--></div>
</div>
Updated: Defining page and block types in EPiServer 7
/blogs/Alexander-Haneng/Dates/2013/1/Updated-Defining-page-and-block-types-in-EPiServer-7/
2013-01-15T15:29:42.0000000Z
<p>When I first wrote my blog series about defining page types and block types in code in EPiServer 7 it was based on EPiServer 7 Preview. Quite a lot changed between the preview and final versions, so it is time for me to update the posts to the final version of EPiServer 7 CMS.</p> <p> </p> <h2>The following blog posts have now been updated:</h2> <p><a href="http://world.episerver.com/Blogs/Alexander-Haneng/Dates/2012/7/How-to-define-properties-in-EPiServer-7---A-quick-reference/">How to define properties in EPiServer 7 - A quick reference</a></p> <p><a href="http://world.episerver.com/Blogs/Alexander-Haneng/Dates/2012/8/How-to-define-Page-Types-in-EPiServer-7---A-quick-reference/">How to define Page Types in EPiServer 7 CMS - A quick reference</a></p> <p><a href="http://world.episerver.com/Blogs/Alexander-Haneng/Dates/2012/8/How-to-create-a-Page-Type-in-code-for-EPiServer-CMS-7/">How to create a Page Type in code for EPiServer CMS 7</a></p> <p><a href="http://world.episerver.com/Blogs/Alexander-Haneng/Dates/2012/8/How-to-create-a-simple-Block-Type-in-EPiServer-CMS-7/">How to create a simple Block Type in EPiServer CMS 7</a></p> <p> </p> <h2>The online SDK</h2> <p>Also check out the <a href="http://sdkbeta.episerver.com/">EPiServer online SDK</a> which is full of useful and up to date stuff, but sadly it is currently not searchable.</p>
EPiImage and EPiServer 7
/blogs/Alexander-Haneng/Dates/2013/1/EPiImage-and-EPiServer-7/
2013-01-15T12:26:21.0000000Z
<p>Can I use EPiImage with EPiServer 7? What is happening with EPiImage going forward?</p> <p> </p> <p>I get a lot of questions regarding EPiImage, so I thought I answer you all with a blog post.</p> <p> </p> <h2>Why have you been so quiet lately?</h2> <p>Since last fall my current project has eaten up all my time, and I haven’t had much time to blog and work on open source projects like EPiImage. Soon I will go into 3 months of paternity leave and will try to keep my days EPiServer free for a change. (Brain: EPiServer out, diapers in).</p> <p>I will however be back to normal speed in May, so expect to hear more from me then. </p> <p> </p> <h2>Does EPiImage work with EPiServer 7?</h2> <p>Currently the answer is <strong><strike>no</strike> yes.</strong> Steve Celius at EPiServer Norway has started work on making the current code working with EPiServer 7,<strike> but it is still a way from doing so</strike>.</p> <p><a href="http://world.episerver.com/Blogs/Alexander-Haneng/Dates/2013/1/EPiImage-for-EPiServer-7-Legacy-release/">Read more here: EPiImage for EPiServer 7: Legacy release</a></p> <p>The goal is to create a Nuget package that will make the current version of EPiImage work in a legacy way with EPiServer 7. Primarily for sites migrating from earlier versions of EPiServer.</p> <p> </p> <h2>Does EPiImageResizer work with EPiServer 7?</h2> <p>It actually does. Joel Abrahamsson asked me that question back in July 2012 and I recompiled the EPiImageResizer for EPiServer 7 Preview back then and it worked like a charm. </p> <p> </p> <p><strike><strong>So if anyone has some spare time:</strong> </strike></p> <p><strike>Please download the source and compile it against EPiServer 7 and create a Nuget package. The files you need are: EPiImageResizer.asx, EPiImageConfiguration.cs and EPiImageEngine.cs-</strike></p> <p> </p> <h2>What is the future of EPiImage and EPiServer 7?</h2> <p>I have some ideas how we could totally rebuild EPiImage to use the cool new UI in EPiServer 7, but I haven’t gotten as far as building anything yet. EPiImage is open source and a collaborative undertaking, so any ideas or code is much appreciated. Unfortunately I won’t contribute anything solid until May 2013.</p> <p> </p> <h2>Status</h2> <p>So that is the status. I would really have liked to have something more positive to tell you (like that the next version of EPiImage is just around the corner), but such is life with a demanding project and small kids.</p>