Last week I was chatting with Tracy Wittenkeller of T-Worx about a common problem he ran into after moving to DotNetNuke 5. The problem is the concept of 'admin' skins on 'admin' pages changed from how it was previously handled in older DNN versions. Those of you who have been working with DNN for over a year are probably familiar that previously admin and host pages were treated differently than other pages (or tabs as they were referred to years ago) than they are now. Previously, all admin and host pages would use the "Admin" skin and container (now referred to as "Edit") set under the site settings (or host settings). Now, however, admin pages are treated like any other page in DNN (and for the most part, host pages are treated the same as well) and will load the "Portal" skin and container set by default.
You can, of course, override the Site Settings (or Host Settings) for the portal skin/container but this requires that you edit each page one by one that needs changed. This can be somewhat of a time consuming process for designers. So, to help Tracy overcome this I wrote an SQL script that can be run from the Host -> SQL tab. Before you execute this, though, there are a few things to keep in mind:
- I have created two scripts, one to be used for a single portal and another to update the host tabs.
- You will need to change the skin file to your own (SET @SkinFile = '[G]Skins/MySkinName/MySkinFile.ascx')
- '[G]Skins' represents Portals/_default/Skins
- '[L]Skins' would represent Portals/PORTALID/Skins - Remember, skins that use this should be installed via Admin -> Extensions, not Host -> Extensions.
- You will need to change the PortalID to the portal you want to update (SET @PortalID = 0, the 0 here is what you update).
- You will need several 'returns' below the GO statement of the script to execute properly
- You will need to check the "Run as Script" checkbox to execute these.
- After execution, you will need to clear the site cache (Host -> Host Settings) in order for DNN to know these updates were made.
DECLARE @SkinFile NVARCHAR(200)
DECLARE @PortalID INT
SET @SkinFile = '[G]Skins/MySkinName/MySkinFile.ascx'
SET @PortalID = 0
UPDATE {databaseOwner}{objectQualifier}Tabs
SET SkinSrc = @SkinFile
WHERE TabName = 'Admin'
OR TabName = 'Site Settings'
OR TabName = 'Pages'
OR TabName = 'Extensions'
OR TabName = 'Languages'
OR TabName = 'Skins'
OR TabName = 'Security Roles'
OR TabName = 'User Accounts'
OR TabName = 'Vendors'
OR TabName = 'Site Log'
OR TabName = 'Newsletters'
OR TabName = 'File Manager'
OR TabName = 'Recycle Bin'
OR TabName = 'Log Viewer'
OR TabName = 'Site Wizard'
OR TabName = 'Google Analytics'
OR TabName = 'Taxonomy'
AND PortalID = @PortalID
GO
/* HOST ONLY */
DECLARE @SkinFile NVARCHAR(200)
SET @SkinFile = '[G]Skins/MySkinName/MySkinFile.ascx'
UPDATE {databaseOwner}{objectQualifier}Tabs
SET SkinSrc = @SkinFile
WHERE TabName = 'Host'
OR TabName = 'Host Settings'
OR TabName = 'Portals'
OR TabName = 'Module Definitions'
OR TabName = 'File Manager'
OR TabName = 'Vendors'
OR TabName = 'SQL'
OR TabName = 'Schedule'
OR TabName = 'Search Admin'
OR TabName = 'Lists'
OR TabName = 'Superuser Accounts'
OR TabName = 'Extensions'
OR TabName = 'Dashboard'
OR TabName = 'What''s New'
OR TabName = 'Marketplace'
AND PortalID IS NULL
GO