Don't miss out Virtual Happy Hour today (April 26).

Try our conversational search powered by Generative AI!

Replace PageTypeBuilder

Vote:
 

We are currently using PageTypeBuilder and want to replace it with EpiServer 7 built in page type support.

To avoid recreating pages on the site I am looking for a way to replace the class created in PTB with the new way, and to avoid loosing information created by the editors.

This is the tool I am using to convert classes: https://github.com/eriknordin/PTB-Helpers

Next step is to change the inheritance on the template to EpiServer.TemplatePage<T> where T is the class built with EpiServer 7 page type support.

By visiting the page this error occur:

ContentData Cast. The requested type Class is not compatible with Castle.Proxies.ClassTypeProxy

Since I change the type on the template this error seems fair. 

I am not really sure about the next step. If we look in the database (tables tblcontent and tblcontenttype) the page created in edit mode is connected to the class genereted by PTB and not my new one of course.

Do I have do modify the database in some way? or have I missed something in my steps above?

The goal here is to make sure nothing is loost when deploying our website.

All help is appreciated!

#72263
Jun 12, 2013 9:55
Vote:
 

I have build an EPiServer 7 version of Erik Nordins tool that can be found at http://talk.alfnilsson.se/2013/03/08/creating-page-type-classes-from-page-types-in-episerver-cms-7/

Make sure that the GUID of your created page type class and the page type in the database is the same.

All your created Page Types have to inherit from PageData or a sub class that inherits PageData.

The other option is to manually edit your Page Type Builder classes and replace the Attributes with EPiServer 7 attributes instead

#72267
Edited, Jun 12, 2013 10:38
Vote:
 

Thanks for your answer Alf. Actually I am using your tool. Added the wrong URL in the post.

I will give it a try and post the result here.

#72269
Jun 12, 2013 10:53
Vote:
 

Marked as answered.

Used the tool to convert my classes and using the same GUID did the trick. Thanks for your answer Alf!

#72542
Jun 20, 2013 8:53
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.