+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Rename master page file

Rename master page file

11 posts, 0 answered
  1. Liam
    Liam avatar
    18 posts
    Registered:
    30 Jun 2010
    28 Sep 2010
    Link to this post
    Hi,

    Is it possible to rename a master page file? I suppose I can rename the file and update appropriate tables?

    Thanks,
    Liam
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    28 Sep 2010
    Link to this post
    Hello Liam,

    You can rename the template name from Sitefinity UI, otherwise the references to all pages that use these template will be lost. If you do this from the file system you have to update [sf_PageContentBase] and set the same TempalteID as the original template.

    Greetings,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Liam
    Liam avatar
    18 posts
    Registered:
    30 Jun 2010
    29 Sep 2010
    Link to this post
    Hi Ivan,

    Thanks for your reply.

    I don't mean the template, I want to rename the underlying physical master page file in App_Master. I did try to rename a master page from within the Files part of the cms admin. However, when I got to the templates I can see that there is a red cross on the icon and that they are broken. I assume because there is a reference somewhere in the database to the old master page file name.

    So how can I rename a master page file in App_Master?

    Thanks.
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    29 Sep 2010
    Link to this post
    Hello Liam,

    Have you tried the other suggestion I have made?

    "If you do this from the file system you have to update [sf_PageContentBase] and set the same TempalteID as the original template"

    There are to simple queries that you have to execute against your database

    1. [sf_PageContentBase] update all references where default master page is set

    UPDATE [CMDEV3].[dbo].[sf_PageContentBase]
    SET MasterPage = 'Default22.master'
    WHERE MasterPage ='Default.master'


    2. [sf_CmsTemplContent] update the Broken value based on the TemplateID

    UPDATE [CMDEV3].[dbo].[sf_CmsTemplContent]
    SET Broken  = 0
    WHERE Broken = 1 AND ID='D7D9C5E2-995F-4F3E-99AB-4F7A110265D4'


    Regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Liam
    Liam avatar
    18 posts
    Registered:
    30 Jun 2010
    29 Sep 2010
    Link to this post
    Hi Ivan,

    Sorry I got a little confused with the talk of renaming templates.

    Your suggestion worked. Although I found that I also had to update the table [sf_StagedPageContent].

    Thanks.

    Regards,
    Liam
  6. Devin
    Devin avatar
    149 posts
    Registered:
    09 Jun 2009
    21 Dec 2010
    Link to this post
    Hi I have a few templates mapped like this:

    TemplateA => templatea.master
    TemplateB => templateb.master
    TemplateC => templateb.master
    TemplateD => templateb.master

    How can I change the mapping of TemplateC and TemplateD without changing TemplateB?

    Thanks!
    Devin
  7. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    21 Dec 2010
    Link to this post
    Hello Devin,

    How these templates were mapped? The page templates cannot be mapped. You can map only embedded resources and I am not sure what do you mean by template mapping of the master file. Can you elaborate some more about this?

    Greetings,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  8. Devin
    Devin avatar
    149 posts
    Registered:
    09 Jun 2009
    21 Dec 2010
    Link to this post
    Hi Ivan,
    Please see the attached screenshot.  I think it is more descriptive.

    Thanks!
    Devin
  9. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    21 Dec 2010
    Link to this post
    Hi Devin,

    You can update the [sf_PageContentBase] where you can set the MasterPage value to TemplateH.master

    Kind regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  10. Devin
    Devin avatar
    149 posts
    Registered:
    09 Jun 2009
    22 Dec 2010
    Link to this post
    Hi Ivan,
    I figured out how to find the row I wanted by checking the DateModified field.  However, there is a ContentPlaceHolder in new masterpage that isn't showing up in the updated templates.  How can I fix this?

    Thanks!
    Devin
  11. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    22 Dec 2010
    Link to this post
    Hi Liam,

    Restart the application, then get the template for edit and save it. You can put some dummy text in the template to verify that you are using the new master file.

    All the best,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Register for webinar
11 posts, 0 answered