If you have a DotNetNuke website that has been around for a while, you likely have a large number of pages on the site. Many of those pages likely have individual Skins (themes) applied to them, we will call those Page Level skins. When there is a skin defined at the Page Level in DNN, that setting overrides the skin that is defined at the Website Level, meaning, if you change the skin at the Website level, it would not change the look and feel of any of the pages with their own skins defined.
This is actually a very common scenario, and you might not want to use the contents of this blog post to change your site. If you do want to remove Page Level skins, continue reading.
Often times when you are going to be updating your website to a new design you want to change the skin on every page of your website, the problem being that for the pages with Page level skins defined, you have to hit each and every page manually in the page settings.
To make this process easier, I’ve written some sample SQL scripts that you can use to clear all page level Skins from a portal. I have also included a script that will do the same for Containers which can be defined at the Page and at the Module level.
In order to execute these scripts you need to use the HOST/SQL page, or you can replace {databaseOwner} with your databaseowner setting from your web.config file (the default is just “dbo.” without the quotes). You also should replace the {objectQualifier} setting from your web.config, (by default that is blank “”). You will also need to replace 0 with the proper PortalID (if you have 1 portal in DNN it is 0, the next is 1, 2, etc)
As with all sample code and sql scripts, I am not responsible for any damage you cause to your or your client’s sites. Always test in a controlled environment before attempting to use in production.
Clear all page level skins in a Portal
update {databaseOwner}{objectQualifier}Tabs
set skinsrc=null
where SkinSrc is not null
and PortalID=0
Clear all page level containers in a Portal
update {databaseOwner}{objectQualifier}tabs
set containersrc=null
where containersrc is not null
and PortalID=0
Clear all module level containers in a Portal
update {databaseOwner}{objectQualifier}TabModules
set ContainerSrc = null
where TabModuleID in (select TabModuleId
from {databaseOwner}{objectQualifier}TabModules tm
join {databaseOwner}{objectQualifier}Modules m
on (tm.ModuleID = m.ModuleID)
where ContainerSrc is not null
and m.PortalId=0)