By Lee Sykes
June 2008
In this tutorial we demonstrate how to quickly administrate modules on a page through the use of SQL queries.
In particular we demonstrate how you can use SQL queries to delete a group of modules from a page, how to move modules from a content pane to a different content pane and how to insert a copy of a module to a page.
The techniques used in this tutorial are especially useful when re-skinning an existing site. For instance, suppose your site consists of a skin which contains several content panes, and it has a few modules which display on all pages. When you apply your new skin, it doesn’t contain as many content panes and you also want to remove some of the modules as they are no longer needed in the new skin, this could take 10 minutes per page just to open each modules settings, move the module to a new content pane and delete the other modules. If you have a large website, for example with 500 pages, this task alone could take 5000 minutes. Of course, this is not an option for a busy professional; therefore we use SQL queries to apply these changes in seconds.
We demonstrate how to move and delete modules from one content pane to another using several techniques and introduce you to using ‘SELECT’, ‘UPDATE’ and ‘DELETE’ SQL queries.
Following this we demonstrate how you can use SQL queries to copy existing modules to a page. This is for modules that are not set to display on all pages, and is the equivalent of using the admin control panel and selecting ‘Add Existing Module’.
Tutorial References
Introduction to using SQL queries with SQL Server Express and DotNetNuke
The videos contain:
Video 1 - Introduction, Deleting Modules Using SQL
- Introduction
- How to change a page skin
- How to delete modules from a page using SQL queries
- How to view the TabModules Table
- How to view the Module ID for a module
- How to view the Tab ID of a page
Time length: 8min 56secs
Video 2 - Deleting Modules from a Page, Moving Modules to a New Content Pane in a Page
- How to use a ‘SELECT’ query to check the correct data is targeted
- How to create a ‘SELECT’ query which displays the data for certain modules on a page
- How to change a ‘SELECT’ query into a ‘DELETE’ query to delete certain modules from a page
- How to move modules between content panes
- How to create a 'SELECT' query which displays the modules on a page
- How to create a 'SELECT' query which displays the modules inserted into the top and bottom content panes on a page
Time length: 7min 52secs
Video 3 - How to Move Modules on All Pages to New Content Panes
- How to change a ‘SELECT’ query to an ‘UPDATE’ query
- How to move modules from the top and bottom content panes in a page to the right pane using SQL
- How to move any module on all pages that are not displayed in the content pane or left pane and move them to the right pane
Time Length: 5min 50secs
Video 4 - How to Copy an Existing Module to a Page using SQL
- How to use SQL to copy existing modules to a page
- Creating a test page
- How to add an existing module
- How to view the data that has been created for the test page
- How to identify the TabID for a page
- How to create an ‘INSERT’ query
Time length: 5min 44secs
Video 5 - Using 'INSERT' queries to Copy Modules
- How to specify which columns you wish to add data into
- Using ‘INSERT INTO’ and ‘VALUES’ to copy an existing module to a page
Time length: 6min 26secs
Total time length: 34min 48secs