<?xml version="1.0" encoding="utf-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><language>en</language><title>Blog posts by Øyvind Wabakken Hognestad</title> <link>https://world.optimizely.com/blogs/Oyvind-Wabakken-Hognestad/</link><description></description><ttl>60</ttl><generator>Optimizely World</generator><item> <title>An alter table database error can occur when upgrading from CMS6 to CMS7.</title>            <link>https://world.optimizely.com/blogs/Oyvind-Wabakken-Hognestad/Dates/2012/11/An-alter-table-database-error-can-occur-when-upgrading-from-CMS6-to-CMS7/</link>            <description>&lt;p&gt;I recently tried to update a customers website from CMS6 R2 to CMS7 and got an error. The error is a database error and the reason is that my root page id &amp;lt;&amp;gt; 1. This customer had root id = 5.&lt;/p&gt;  &lt;p&gt;This is the error message:&lt;/p&gt;  &lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;An unhandled error has occured:
The ALTER TABLE statement conflicted with the FOREIGN KEY SAME TABLE constraint
 &lt;span class=&quot;str&quot;&gt;&amp;quot;FK_tblContent_tblContent&amp;quot;&lt;/span&gt;. The conflict occurred &lt;span class=&quot;kwrd&quot;&gt;in&lt;/span&gt; database &lt;span class=&quot;str&quot;&gt;&amp;quot;dbForskningspar
kenUpgrade&amp;quot;&lt;/span&gt;, table &lt;span class=&quot;str&quot;&gt;&amp;quot;dbo.tblContent&amp;quot;&lt;/span&gt;, column &lt;span class=&quot;str&quot;&gt;&#39;pkID&#39;&lt;/span&gt;.
When executing
At C:\Program Files (x86)\EPiServer\CMS\7.0.586.1\Upgrade\System Scripts\Upgrad
e Site Database (SqlServer).ps1:9 &lt;span class=&quot;kwrd&quot;&gt;char&lt;/span&gt;:25
+       Execute-EPiSqlSvrScript &amp;lt;&amp;lt;&amp;lt;&amp;lt;  -EPiServerScript -ScriptPath $file &lt;br /&gt;-SqlServerName $dbConnection.DataSource -DatabaseName $dbConnection.InitialCatalog &lt;br /&gt;-LoginName $dbConnection.UserID -LoginPassword $dbConnection.Password&lt;/code&gt;&lt;/pre&gt;
&lt;style type=&quot;text/css&quot;&gt;



.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, &quot;Courier New&quot;, courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;A god thing, it’s easy to do a workaround:&lt;/p&gt;

&lt;p&gt;* Open&amp;#160; this script : 
  &lt;br /&gt;&amp;quot;C:\Program Files\EPiServer\CMS\7.0.586.1Upgrade\Database\sql\ 0007_0000_0147_0000to0007_0000_0361_0000.sql&amp;quot;.&lt;/p&gt;

&lt;p&gt;* Find this insert: 
  &lt;br /&gt;&lt;/p&gt;

&lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;INSERT INTO tblContent (fkContentTypeID,fkParentID,ArchiveContentGUID, CreatorName,
ContentGUID,VisibleInMenu,Deleted,PendingPublish,ChildOrderRule,PeerOrder,
ExternalFolderID,fkMasterLanguageBranchID,ContentPath,ContentType) VALUES (
@fkContentTypeId,--fkContentTypeID
1,--fkParentID&lt;/code&gt;&lt;/pre&gt;
&lt;style type=&quot;text/css&quot;&gt;


.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, &quot;Courier New&quot;, courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;style type=&quot;text/css&quot;&gt;



.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, &quot;Courier New&quot;, courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;* Change the 1 to your root page id, in my case 5.&lt;/p&gt;

&lt;p&gt;* Rerun the update from CMS6 to CMS7 in Deployment Center. Worked like a charm, except for the compilation error, but that’s another story.&lt;/p&gt;</description>            <guid>https://world.optimizely.com/blogs/Oyvind-Wabakken-Hognestad/Dates/2012/11/An-alter-table-database-error-can-occur-when-upgrading-from-CMS6-to-CMS7/</guid>            <pubDate>Fri, 30 Nov 2012 12:06:57 GMT</pubDate>           <category>Blog post</category></item><item> <title>PageName vs UrlSegment Report</title>            <link>https://world.optimizely.com/blogs/Oyvind-Wabakken-Hognestad/Dates/2010/2/PageName-vs-UrlSegment-Report/</link>            <description>&lt;p&gt;When editors start putting content in their empty site, they will probably start with some test pages or not a well thoughtful page name in the structure. Later the editors often change page names several times until they are satisfied and at the end the site goes live.&lt;/p&gt;  &lt;p&gt;What many of the editors don’t know is that the Url Segment of the page only are set the first time the page is published. Since the Url Segment property is found on the Advanced Panel in Editmode, many editors do not see nor have the necessary permissions rights to access this panel / property.&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;/link/bb9c1eba80fe4e28a31322b1b892ad74.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; title=&quot;PageNameVsUrlSegment&quot; border=&quot;0&quot; alt=&quot;PageNameVsUrlSegment&quot; src=&quot;/link/47115005fa494e4a943747e2021ef9a8.png&quot; width=&quot;632&quot; height=&quot;331&quot; /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;So, to help the editors in their daily work, I created a simple report which displays the pages that differ between the page name and the expected Url Segment. This report will give the editor a quick overview of the pages that differ. I don’t see how an editor can find these pages in a sensible time another way. &lt;/p&gt;  &lt;p&gt;Remember that changing the Url Segment after the site is live will have an impact on the SEO and previously indexed url’s. A nice feature would be to combine the change of the Url Segment with this logic &lt;a href=&quot;http://world.episerver.com/Blogs/Magnus-von-Wachenfeldt/Dates/2010/2/Update-to-the-Url-Mapping-Module/&quot;&gt;http://world.episerver.com/Blogs/Magnus-von-Wachenfeldt/Dates/2010/2/Update-to-the-Url-Mapping-Module/&lt;/a&gt; and &lt;a href=&quot;https://www.coderesort.com/p/epicode/wiki/404Handler&quot; target=&quot;_blank&quot;&gt;the 404 Handler from EPiCode&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;You can download the project from EPiCode:    &lt;br /&gt;&lt;a href=&quot;https://www.coderesort.com/p/epicode/browser/EPiCode.ReportCenter.Reports&quot;&gt;https://www.coderesort.com/p/epicode/browser/EPiCode.ReportCenter.Reports&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Would be nice with some ajax functionality on this report, feel free to update the report with improvements.&lt;/p&gt;</description>            <guid>https://world.optimizely.com/blogs/Oyvind-Wabakken-Hognestad/Dates/2010/2/PageName-vs-UrlSegment-Report/</guid>            <pubDate>Fri, 19 Feb 2010 14:24:37 GMT</pubDate>           <category>Blog post</category></item><item> <title>Globalization, categories and sorting using LINQ</title>            <link>https://world.optimizely.com/blogs/Oyvind-Wabakken-Hognestad/Dates/2009/8/Globalization-categories-and-sorting-using-LINQ/</link>            <description>&lt;p&gt;I have been working with a globalized website for some time and have a couple of tips to share regarding globalization.&lt;/p&gt;  &lt;p&gt;I’m using FindPagesWithCriteria to get pages based on categories defined on pages. As we teach during the EPiServer developer course FindPagesWithCriteria uses queries directly to the database. The method has got a performance boost in EPiServer CMS5, but should never be used on a typical landing page without caching. &lt;/p&gt;  &lt;p&gt;Categories are quite useful if you do not need the complete Topic Maps structure. &lt;a href=&quot;http://labs.episerver.com/en/Blogs/Anders-Hattestad/Dates/2009/3/Category---more-than-labeling/&quot; target=&quot;_blank&quot;&gt;Anders Hattestad&lt;/a&gt; has written a nice post on how to create a custom property to display a part of the categorytree.&lt;/p&gt;  &lt;p&gt;Well, back to the topic. Using FindPagesWithCriteria will &lt;strong&gt;not &lt;/strong&gt;return the pages as they are displayed in editmode with fallback and replacement languages (which I hopefully thought). After some testing I found that the best way to get the pages I needed was to use LanguageSelector.AutoDetect(true) as the last parameter.&lt;/p&gt;  &lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;border-right: silver 1px solid; padding-right: 4px; border-top: silver 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: silver 1px solid; width: 97.5%; cursor: text; direction: ltr; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: silver 1px solid; font-family: &#39;Courier New&#39;, courier, monospace; background-color: #f4f4f4; text-align: left&quot;&gt;   &lt;div id=&quot;codeSnippet&quot; style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none&quot;&gt;     &lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none&quot;&gt;&lt;span id=&quot;lnum1&quot; style=&quot;color: #606060&quot;&gt;   1:&lt;/span&gt; PageDataCollection pages = &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none&quot;&gt;&lt;span id=&quot;lnum2&quot; style=&quot;color: #606060&quot;&gt;   2:&lt;/span&gt; DataFactory.Instance.FindPagesWithCriteria(searchFrom, crits, &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none&quot;&gt;&lt;span id=&quot;lnum3&quot; style=&quot;color: #606060&quot;&gt;   3:&lt;/span&gt; language, LanguageSelector.AutoDetect(&lt;span style=&quot;color: #0000ff&quot;&gt;true&lt;/span&gt;));&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;The pages collection will now also contain pages not translated to the current language. So, with a little help from reflector I removed the unwanted pages like this.&lt;/p&gt;

&lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;border-right: silver 1px solid; padding-right: 4px; border-top: silver 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: silver 1px solid; width: 97.5%; cursor: text; direction: ltr; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: silver 1px solid; font-family: &#39;Courier New&#39;, courier, monospace; background-color: #f4f4f4; text-align: left&quot;&gt;
  &lt;div id=&quot;codeSnippet&quot; style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none&quot;&gt;
    &lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none&quot;&gt;&lt;span id=&quot;lnum1&quot; style=&quot;color: #606060&quot;&gt;   1:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;static&lt;/span&gt; PageDataCollection FilterForFallbackLanguages(PageReference pageLink, &lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt; languageBranch, PageDataCollection result )&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none&quot;&gt;&lt;span id=&quot;lnum2&quot; style=&quot;color: #606060&quot;&gt;   2:&lt;/span&gt;        {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none&quot;&gt;&lt;span id=&quot;lnum3&quot; style=&quot;color: #606060&quot;&gt;   3:&lt;/span&gt;            PageLanguageSetting setting = PageLanguageSettingsTree.Instance.Get(pageLink, languageBranch);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none&quot;&gt;&lt;span id=&quot;lnum4&quot; style=&quot;color: #606060&quot;&gt;   4:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none&quot;&gt;&lt;span id=&quot;lnum5&quot; style=&quot;color: #606060&quot;&gt;   5:&lt;/span&gt;            &lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt; (setting != &lt;span style=&quot;color: #0000ff&quot;&gt;null&lt;/span&gt;)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none&quot;&gt;&lt;span id=&quot;lnum6&quot; style=&quot;color: #606060&quot;&gt;   6:&lt;/span&gt;            {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none&quot;&gt;&lt;span id=&quot;lnum7&quot; style=&quot;color: #606060&quot;&gt;   7:&lt;/span&gt;                List&amp;lt;&lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt;&amp;gt; fallback = &lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; List&amp;lt;&lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt;&amp;gt;(setting.LanguageBranchFallback);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none&quot;&gt;&lt;span id=&quot;lnum8&quot; style=&quot;color: #606060&quot;&gt;   8:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none&quot;&gt;&lt;span id=&quot;lnum9&quot; style=&quot;color: #606060&quot;&gt;   9:&lt;/span&gt;                &lt;span style=&quot;color: #0000ff&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #0000ff&quot;&gt;int&lt;/span&gt; i = result.Count - 1; i &amp;gt;= 0; i--)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none&quot;&gt;&lt;span id=&quot;lnum10&quot; style=&quot;color: #606060&quot;&gt;  10:&lt;/span&gt;                {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none&quot;&gt;&lt;span id=&quot;lnum11&quot; style=&quot;color: #606060&quot;&gt;  11:&lt;/span&gt;                    &lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt; (result[i].LanguageBranch != setting.LanguageBranch &amp;amp;&amp;amp; fallback.Contains(result[i].LanguageBranch) == &lt;span style=&quot;color: #0000ff&quot;&gt;false&lt;/span&gt;)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none&quot;&gt;&lt;span id=&quot;lnum12&quot; style=&quot;color: #606060&quot;&gt;  12:&lt;/span&gt;                        result.RemoveAt(i);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none&quot;&gt;&lt;span id=&quot;lnum13&quot; style=&quot;color: #606060&quot;&gt;  13:&lt;/span&gt;                }         &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none&quot;&gt;&lt;span id=&quot;lnum14&quot; style=&quot;color: #606060&quot;&gt;  14:&lt;/span&gt;            }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none&quot;&gt;&lt;span id=&quot;lnum15&quot; style=&quot;color: #606060&quot;&gt;  15:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none&quot;&gt;&lt;span id=&quot;lnum16&quot; style=&quot;color: #606060&quot;&gt;  16:&lt;/span&gt;            &lt;span style=&quot;color: #0000ff&quot;&gt;return&lt;/span&gt; result;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none&quot;&gt;&lt;span id=&quot;lnum17&quot; style=&quot;color: #606060&quot;&gt;  17:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none&quot;&gt;&lt;span id=&quot;lnum18&quot; style=&quot;color: #606060&quot;&gt;  18:&lt;/span&gt;        }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Then my collection was complete. The last step was to sort the collection so the pages of the origin language – Norwegian – came first in the list and the fallback language – English - at the bottom of the list. In addition the sorting inside the language should be PageName. I could write my own comparer or my own filter but a better, and much easier solution, is to use LINQ (thanks Ahsan at support who suggested this solution to a partner in a post I came across while surfing around). &lt;/p&gt;

&lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;border-right: silver 1px solid; padding-right: 4px; border-top: silver 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: silver 1px solid; width: 97.5%; cursor: text; direction: ltr; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: silver 1px solid; font-family: &#39;Courier New&#39;, courier, monospace; background-color: #f4f4f4; text-align: left&quot;&gt;
  &lt;div id=&quot;codeSnippet&quot; style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none&quot;&gt;
    &lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none&quot;&gt;&lt;span id=&quot;lnum1&quot; style=&quot;color: #606060&quot;&gt;   1:&lt;/span&gt; var sorted = from page &lt;span style=&quot;color: #0000ff&quot;&gt;in&lt;/span&gt; pages&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none&quot;&gt;&lt;span id=&quot;lnum2&quot; style=&quot;color: #606060&quot;&gt;   2:&lt;/span&gt; orderby page.LanguageID descending, page.PageName ascending &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none&quot;&gt;&lt;span id=&quot;lnum3&quot; style=&quot;color: #606060&quot;&gt;   3:&lt;/span&gt; select page;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none&quot;&gt;&lt;span id=&quot;lnum4&quot; style=&quot;color: #606060&quot;&gt;   4:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none&quot;&gt;&lt;span id=&quot;lnum5&quot; style=&quot;color: #606060&quot;&gt;   5:&lt;/span&gt; pageList.DataSource = sorted;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none&quot;&gt;&lt;span id=&quot;lnum6&quot; style=&quot;color: #606060&quot;&gt;   6:&lt;/span&gt; pageList.DataBind();&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;To get this to work I needed to change the webcontrol which render this list from EPiServer:PageList to Asp:Repeater. EPiServer:PageList do not support this and you will get an error like this if you try. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;System.NotSupportedException: Specified method is not supported.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;After changing the webcontrol from EPiServer:PageList to Asp:Repeater, remember to use the FilterForVisitor.Filter(pages); to set the right security and remove the unpublished pages.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Globalization is cool, it works like a charm in most cases, but be aware of that the time used to develop could take a little longer than you think. Perhaps more important – put some effort when testing the site after the content is in place and real fallback and replacement language is set.&lt;/p&gt;</description>            <guid>https://world.optimizely.com/blogs/Oyvind-Wabakken-Hognestad/Dates/2009/8/Globalization-categories-and-sorting-using-LINQ/</guid>            <pubDate>Tue, 04 Aug 2009 11:43:46 GMT</pubDate>           <category>Blog post</category></item><item> <title>Helping the editors to take the right decisions with control adapters</title>            <link>https://world.optimizely.com/blogs/Oyvind-Wabakken-Hognestad/Dates/2009/7/Helping-the-editors-to-take-the-right-decisions-with-control-adapters/</link>            <description>&lt;p&gt;Sometimes when I’m out helping partners and customers I’m getting quite disappointed of the small things that developers don’t do to help editors do their daily work. Sure, we can develop good solutions and great plugins, but there are other small steps to easier the editors day at work.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Pagetypes &lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Hide the pagetypes that are not in use or only shall be created one time on the site (f.ex. the startpage, loginpage, searchpage). This limits the list of pagetypes the editor have to choose from when wanting to create a new page. It’s easy, just tick this checkbox.&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;/link/b0d8dc80d94b40c48ab6f64914ab823e.png&quot;&gt;&lt;img title=&quot;Pagetype1&quot; style=&quot;border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px&quot; height=&quot;174&quot; alt=&quot;Pagetype1&quot; src=&quot;/link/97fa2d19bb3b4065934a14ba652f1820.png&quot; width=&quot;244&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Use the Available Page Types panel. This will limit the list for the editors even more.&lt;/p&gt;  &lt;p&gt;Sort the pagetypes so the most used templates will appear at the top of the list when an editor creates a new page.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Properties&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Sort the properties for the pagetype. It’s not a good idea to have important properties at the bottom of the panel. If you have take a look at the public package from EPiServer, the writer property is below both MainBody and SecondaryBody. Even with a high screen resolution you will probably forget this property if you do not scroll the whole way down to find it. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Use the Help Text&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Ever used the Help Text for the property ?&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;/link/a0363734f3e144b4bee5a7e49a9cad71.jpg&quot;&gt;&lt;img title=&quot;HelpText2&quot; style=&quot;border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px&quot; height=&quot;189&quot; alt=&quot;HelpText2&quot; src=&quot;/link/f1da52c27f574754837f74ea666fe293.jpg&quot; width=&quot;393&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;During development and just after the release of the solution the name of the property and the purpose of the property is well known. But after a couple of months and you log in to the solution this purpose is not often that clear. &lt;/p&gt;  &lt;p&gt;I try to use the Help Text, often together with the webmaster of the site. The users often have a better way of explaining the purpose than the developer and together you can create a informative text. The downside is that i found out that the editors newer took a look at this text. Since not all properties have a Help Text, the editor did not keep their mouse above the label for a couple of seconds to see if the Help Text appeared (yes, that’s the way to show the Help Text).&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;/link/d45e7911628a4850a650559beefafde5.png&quot;&gt;&lt;img title=&quot;HelpText3&quot; style=&quot;border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px&quot; height=&quot;225&quot; alt=&quot;HelpText3&quot; src=&quot;/link/d6022db5de684231bc73bb1d8ad4fc3c.png&quot; width=&quot;525&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;So the solution in my case were control adapters and a little javascript displaying the Help Text as a information box on the page.&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;/link/e7cddec619bd448d87d07d83a0a83ac2.png&quot;&gt;&lt;img title=&quot;HelpText4&quot; style=&quot;border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px&quot; height=&quot;266&quot; alt=&quot;HelpText4&quot; src=&quot;/link/08396f7e55bf4724aa334ec2da52e874.png&quot; width=&quot;479&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&amp;#160; &lt;/p&gt;  &lt;p&gt;By using control adapters I’m adding a questionmark after the property to inform the editor that the property has a Help Text which will give more information regarding the purpose of the property. &lt;/p&gt;  &lt;p&gt;By using the mouseover event I display the Help Text for the editor and the editor can easily se which properties that have a Help Text.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Control Adapter&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;It’s easy to add a new control adapter in the AdapterMappings.browser file. In my case i needed a new control adapter for each property type I wanted to use with the questionmark. Here is one:&lt;/p&gt;  &lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;border-right: silver 1px solid; padding-right: 4px; border-top: silver 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: silver 1px solid; width: 97.5%; cursor: text; direction: ltr; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: silver 1px solid; font-family: &#39;Courier New&#39;, courier, monospace; background-color: #f4f4f4; text-align: left&quot;&gt;   &lt;div id=&quot;codeSnippet&quot; style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none&quot;&gt;     &lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none&quot;&gt;&lt;span id=&quot;lnum1&quot; style=&quot;color: #606060&quot;&gt;   1:&lt;/span&gt; &amp;lt;adapter controlType=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;EPiServer.Web.PropertyControls.PropertyStringControl&amp;quot;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none&quot;&gt;&lt;span id=&quot;lnum2&quot; style=&quot;color: #606060&quot;&gt;   2:&lt;/span&gt;                adapterType=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;SuoWeb.PublicWeb.Library.ControlAdapters.PropertyStringAdapter&amp;quot;&lt;/span&gt; /&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none&quot;&gt;&lt;span id=&quot;lnum3&quot; style=&quot;color: #606060&quot;&gt;   3:&lt;/span&gt;       &lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Here are the code if you would like to take a look. &lt;/p&gt;

&lt;div class=&quot;wlWriterSmartContent&quot; id=&quot;scid:fb3a1972-4489-4e52-abe7-25a00bb07fdf:1e24a744-5249-4292-b73a-c77cc1f3cba0&quot; style=&quot;padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px&quot;&gt;
  &lt;p&gt;Base adapter for all properties &lt;a href=&quot;/link/9db4903ddaeb4e55b136de024527e18b.js&quot; target=&quot;_blank&quot;&gt;PropertyStringAdapter&lt;/a&gt; 

    &lt;br /&gt;Javascript &lt;a href=&quot;/link/7865227351244a5ba2f34edb1460fc07.cs&quot; target=&quot;_blank&quot;&gt;BoxOver.js&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Some issues&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The rendering of the properties differ. It differ for the different types and if the property is required or not. It’s also worth mentioning that the control adapters should be tested when you do Compare Languages if you have a globalized site. I had to remove rendering of my Help Text in this mode.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Don’t forget editors when your solution has left your computer and gone in production. &lt;/p&gt;</description>            <guid>https://world.optimizely.com/blogs/Oyvind-Wabakken-Hognestad/Dates/2009/7/Helping-the-editors-to-take-the-right-decisions-with-control-adapters/</guid>            <pubDate>Mon, 20 Jul 2009 17:55:10 GMT</pubDate>           <category>Blog post</category></item></channel>
</rss>