Try our conversational search powered by Generative AI!

Changing the name of startPage and I want to use the content created with the earlier name

Vote:
 

Hello All,

I am creating a website where start page of my website is of type StartPage .I have created the pages and added other child pages under startpage.

Now due to some circumstances I need to change the name of StartPage PageType.Is it possible to do as I want to reuse the content set for earlier start page.

Deleting the startpage is not an option because in that case all the child pagetypes needs to be deleted and configure it once again.

Please provide me any suggestion on that.

#148393
May 11, 2016 21:28
Vote:
 

Do you only want to change the name of the content type visible for the editor? For example from "Start Page" to "My Super Start Page"?
If so just change or add the DisplayName property according to http://world.episerver.com/documentation/Items/Developers-Guide/Episerver-CMS/9/Content/Attributes/

If you want to change the class name that represents your StartPage, I hope that you have added a GUID to your ContentType attribute.
If not, look in the tblContentType table in your database for the row that represents your StartPage. Copy the GUID and add it to the GUID property of ContentType attribute.
After that you only need to change the class name of the Page Type. Episerver will understand that you have updated the Page Type as the GUID is the same as earlier.

If you only want to change the name of your Start Page in the page tree, there's nothing preventing you to just change the name as all references to content in Episerver are using ContentReference or PageReference (wrapping the id to the content).

If you have already created your new Page Type and want to convert your existing start page to the new one, use the Convert Page Type function in admin mode - http://webhelp.episerver.com/14-1/EN/#EN/CMS Admin/Admin_ConvertPages.htm%3FTocPath%3DAdministering%2520the%2520website%7CContent%2520types%7C_____1

#148397
May 11, 2016 22:48
Vote:
 

You can it like this using Migration class

public class Migration : MigrationStep
    {
        public override void AddChanges()
        {
ContentType("NewStartPageName").UsedToBeNamed("OldStartPageName");
        }
    }

Hope it helps!

#148407
Edited, May 12, 2016 8:26
Vote:
 

Gayathri

If you want to change so that the code looks like it had the correct name the first time you wrote it, migrationsteps will only add extra code

By the way I found how you can see the Content Type GUID without going to the database

  • Go to admin mode, click the tab "Content Type" and find your page type.
  • Click the button "Information"
  • In the box "Advanced" you'll see the Content Type GUID
#148413
May 12, 2016 9:28
Vote:
 

Thanks @alif

#154985
Sep 06, 2016 13:45
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.