This post describes a particular issue that occurs when copy/pasting pages in EPiServer CMS 6 R2 when using EPiServer Composer and Page Type Builder.

The problem

The problem occurs if all of the following are true:

  • Your site uses EPiServer CMS 6 R2
  • You are using Composer
  • Page Type Builder is being used
  • You are using Page Type Builder to restrict available page types
  • Users try to copy a page or pages that container Composer pages

The result is that the background paste operation fails.

Cause

The log reveals an error message that says something like: "Pagetype [ExtensionSys] Extension Container is not allowed to be created below parent with page type [Public] Content page".

This is because the page type "[ExtensionSys] Extension Container" is used internally by Composer. However if you use the AvailablePageTypes property of the PageType attribute in Page Type Builder then it removes all available page types then only adds the ones in the allowed types list. 

The solution

The quick work around is to enable "[ExtensionSys] Extension Container" as an available page type for your composer pages. Obviously this will only work until the application is recycled.

The fuller solution is to create a page type for "[ExtensionSys] Extension Container" and ensure that its referenced in the AvailablePageTypes property of the PageType attribute of PageTypeBuilder. The following code is an example of how this can be achieved:

[ExtensionSys] Extension Container page type

[PageType(
  AvailableInEditMode = false,
  Name = "[ExtensionSys] Extension Container",
  Description = "[ExtensionSys] Extension   Container",
  Filename = "/DropIT/Plugin/Extension/UI/Edit/ExtensionData.aspx", 
  SortOrder = 1000)]
public class ExtentionSys_ExtensionContainer : TypedPageData
{
}

Then its simply a case of adding a reference to this page type in your PageType declaration:

[PageType(
  Name = "[Public] Composer page",
  Description = "Composer page",
  Filename = "/Templates/Composer.aspx",
  AvailablePageTypes = new[] { 
      typeof(PageType1)
    , typeof(PageType2)
    , typeof(ExtentionSys_ExtensionContainer) },
  SortOrder = 200)]
public class SomePageType : TypedPageData
{
....
}

Conclusion

Ultimately this is a work around to deal with the way Composer and Page Type Builder have been implemented. Neither implementation is necessarily wrong, just they don't play nicely together when working in EPiServer CMS 6 R2!

Feedback

I'd be happy to hear any feedback on the comments below or @davidknipe


Comments