Jasinski Technical Wiki

Navigation

Home Page
Index
All Pages

Quick Search
»
Advanced Search »

Contributor Links

Create a new Page
Administration
File Management
Login/Logout
Your Profile

Other Wiki Sections

Software

PoweredBy

Sublayout Renaming - Sitecore

RSS
Modified on Fri, Apr 20, 2012, 10:13 AM by Administrator Categorized as Sitecore

Overview

Occasionally it is necessary to rename a Sitecore sublayout. This article describes how.

Procedure

SQL

The following SQL, when run against the MASTER database, will give you the row that contains the path to the sublayout of interest.

select 
    * 
from 
    dbo.SharedFields 
where 1=1
    and ItemId = 'SublayoutGuid'
    and FieldId = 'E42081B6-8A95-4A11-89CE-DF70ED502F57'

Alternate SQL

The following SQL requires the dbo.ItemTree view, found here. Use the first query to determine the value to use in the other two. When you run Query 2, make note of the Value column value. You can use it (modified, of course) in Query 3.

/*--- Query 1 ---*/
select 
     ItemPath
    ,FilePath = Value    
    ,[SharedFields.ID] = f.ID
from 
    dbo.SharedFields f
    inner join dbo.ItemTree t
        on f.ItemId = t.ID
where 1=1
    and FieldId = 'E42081B6-8A95-4A11-89CE-DF70ED502F57'
    and t.ItemPath like '/sitecore/layout/sublayouts/globalpayments%'
order by
    ItemPath

/*--- Query 2 ---*/
select * from dbo.SharedFields f where f.Id = '[SharedFields.ID] from first query'

/*--- Query 3 ---*/
update dbo.SharedFields
set Value = 'new value'
where ID = '[SharedFields.ID] from first query'

Other Considerations

When renaming a sublayout, be sure to change the following as well.

  • The name of the file in Visual Studio
  • The class name in the .ASCX.CS file
  • The class name in the .ASCX.DESIGNER.CS file
  • The Inherits attribute in the <%@ Control %> directive in the .ASCX file

You must also publish the sublayout under its new name before it will be available on the website.

ScrewTurn Wiki version 3.0.1.400. Some of the icons created by FamFamFam. Except where noted, all contents Copyright © 1999-2024, Patrick Jasinski.