EPiServer CMS bug when upgrading with deployment center

Error described:


At C:\Program Files (x86)\EPiServer\CMS\6.0.530.0\Upgrade\System Scripts\Upgrade Site (SqlServer).ps1:361 char:29
+                  $newUiUrl = $uiUrl.Replace <<<< ($uiPath, $uiPath+"/CMS")
System.Management.Automation.ParentContainsErrorRecordException: Cannot convert argument "1", with value: "/CMS", for "Replace" to type "System.Char": "Cannot convert value "/CMS" to type "System.Char". Error: "Strängen måste vara exakt ett tecken lång."" 

The problem is that the site had asolute url for ui in sitesettigns, because of ui running under SSL.

Changing the value to ~ui solved the problem.

Conclusion, you can not upgrade sites using https with their tool, without manually fixing this

Entity Framework missing in Visual Studio 2010

I could not find the template for Entity Framework (AdoNetEntityDataModelCSharp.zip) package in my Visual Studio 2010 Ultimate installation.

So I looked for a solution but could not find one that worked for me so I installed it again on another computer, and therefor (dont know how) I got the correct zip file for csharp (C#) templates.



So, for all of you poor Visual Studio users looking for Entity Framework EF, here is the actual zip file that is needed for Visual Studio 2010

put it in the correct place, default path is something like:
C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplates\CSharp\Data\1033

Download Entity Data Model template zip file here (link broken, working on a new file): vs2010_entity_data_framework_itemtemplate.zip

EPiServer 6 problems with configuration

Some errors that I ran into when setting up EPiServer CMS 6 on my Vista with IIS 7.0 running in .NET 4, and how to get it working

ICallbackEVentHandler error
In web.config under system.web / pages , set clientIDMode="AutoID"

Can not see wastebasket or root page
Occurs when installing the package.
Change the page types sysroot and sysRecycleBin settings to correct path to the .aspx file

Lots of javascript errors in edit and admin mode
In web.config, set access rights for location path="Util", for example set same roles as for the edit path, usually WebAdmin, WebEditors, Adminstrators

EpiServer - simple plugin to lookup page from PageFiles ID

Each page in EPiServer has a directory in VPP PageFiles (created when first uploading a file to it) directory.


For example: \\myFileServer\VPP\PageFiles\35566\my_pic.gif

However, the ID after PageFiles has nothing to do with the page id in EPiserver.

You can get the ID from the page using the CurrentPage["PageFolderID"]

Here is a very simple and small plug-in (action window section) to be used to quickly find the page for a specific PageFiles ID. (you have to provide your own loading.gif though)

Markup:


<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="FindPageFromPagefileId.ascx.cs"
    Inherits="Additions.Plugins.FindPageFromPagefileId" %>

<h1>
   Find page from pagefile ID</h1>
<br />
<p>
    PageFiles ID</p>
    <asp:TextBox runat="server" Width="90"  ID="txtPageFileID"></asp:TextBox>

    <asp:Button runat="server" ID="Button1" Text="Leta sida"
    onclick="Button1_Click" OnClientClick="loading()" />

    <br /><br />
    <div id="loader" style="display:none;">
        <image src="/UI/Images/loading.gif" />
    </div>
    <br />
    <asp:HyperLink runat="server" ID="linkPage"></asp:HyperLink>
    <p>
    <asp:Label runat="server" ID="msg" ForeColor="Red"></asp:Label>
    </p>

    <script type="text/javascript">
        function loading() {
            document.getElementById('loader').style.display = "block";
        }
    </script>

And codebehind:


[GuiPlugIn(DisplayName = "Find page from pagefiles ID", Area = PlugInArea.ActionWindow, 
Description = "Find page using specific pagefiles ID"
Url = "~/UI/Additions/Plugins/FindPageFromPagefileId.ascx", SortIndex = 60)]
    public partial class FindPageFromPagefileId : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            if (txtPageFileID.Text.Length < 1)
                return;
            IList<PageReference> pages = DataFactory.Instance.GetDescendents(PageReference.RootPage);
            linkPage.Text = "<span style=\"color:red\">Page could not be found</span>";
            linkPage.NavigateUrl = "";

            foreach (PageReference pr in pages)
            {
                PageData pd = DataFactory.Instance.GetPage(pr);

                if (pd != null && pd.Property["PageFolderID"] != null)
                {
                    object pagefilesID = pd.Property["PageFolderID"].Value;

                    if (pagefilesID != null && pagefilesID.ToString() == txtPageFileID.Text)
                    {
                        linkPage.Text = "&raquo; " + pd.PageName;
                        linkPage.NavigateUrl = pd.LinkURL;
                        break;
                    }
                }
            }
        }
    }

EPiServer 6 does not support HTML 5

Just recently I was working in a project as Epi developer for a big site in Sweden.

We decided to go for HTML 5 since it is the upcoming version of html, xhtml seemed a little too old to us.

However, EPiServer CMS 6 does not support HTML 5, you can not validate a site built with html 5, it is not possible.

And how is that?

It is because EPiServer has its own parser that goes through the output when rendering the page, and the parser is designed to follow the XHTML standards only.

And what happens with HTML5 then?

The parser moves the <noscript> tag and put it outside the "head" tag, and before the "body" tag. That is not legal in html 5, where you want it to reside in the "head".

And furthermore I have spoken to EPi support and they say it will not be fixed in any way until a totally new version of EPi comes, ie EPi 7 I guess.

I thought that they might have added some flag in the site settings in episerver.config that told the parser what markup standard to follow, but it was not something that they would spend hours on to fix.

Another sign of non-html5-compatibility in EPiServer 6 is that the DOCTYPE is messed up:

The correct:
<!DOCTYPE html>
becomes:
<!DOCTYPE HTML PUBLIC "" "">
so we had to make a httpmodule to replace the doctype text.



Conclusion
Well, sadly, you can never release a html 5 site that validates, using the EPiServer CMS product.

Never use Episerver controls when listing pages without group Everyone

Was really confused why the list was empty, but realized after a while that the Episerver control PageList automatically removes all pages that the users have no right to see.

Pretty obvious you might think, but since it is common practice to use EPi pages as dataholders, often in a hidden [Data] structure outside the StartPage tree, and those pages lacks the Everyone (Read), the developers must remember to use a regular asp Repeater instead.

The methods DataFactory.Instance.GetPage() and GetChildren() always return everything without checking any  permissions, well thats old information by now (from EPi 5)

It would be nice if Episerver added some logic to the controls so that you could tell the PageList-control the authorization behaviour needed.

Use the old editor in EPiServer CMS 6 instead of TinyMCE

Since the TinyMCE editor cannot use the Edit Menu Name functionality for css classes, there are reasons to use the legacy editor instead. Another reason is that "paste unformatted.." is moved to a button wich opens up a dialog where you can paste your formatted text. A little bit annoying I think.

Well, it is easy to get back to "the good old days" :-)

In web.config there is a section for this already implemented.

Just uncomment the second part.

<!-- Uncomment the following two lines to get legacy editor in edit mode for PropertyXhtmlString and PropertyLongString-->
<!--<register type="EPiServer.SpecializedProperties.PropertyXhtmlString, EPiServer" 
mappedType="EPiServer.Web.PropertyControls.LegacyPropertyXhtmlStringControl, EPiServer" />
    <register type="EPiServer.Core.PropertyLongString, EPiServer" 
mappedType="EPiServer.Web.PropertyControls.LegacyPropertyXhtmlStringControl, EPiServer" />-->