How to create Page Templates in DotNetNuke

By Lee Sykes
September 2007

In this tutorial we demonstrate how to use and create page templates in DotNetNuke.

Page templates allow you to add modules, data, and configuration settings to a page when you first create a new page.
 
This is a fantastic time saving tool, for instance if you have certain modules that you regularly need to add to a page, you can do this automatically with a page template. If you have content in a Text / HTML module that you always use as a starting point, you can have default content added to a module through a page template.

Page templates are a powerful technique and we have discovered an easy way to create them without needing any specialist knowledge or coding skills.

In these video tutorials we demonstrate how to create a simple page template using a Text / HTML module and then we progress onto how to create a page template with multiple modules using different content panes, different containers and different module settings.

Video 1 - Introduction, default page template, code explanation

  • Introduction
  • Demonstration of using the default page template
  • How to create your first page template with a Text / HTML module
  • Locating the templates files in your DotNetNuke installation
  • Viewing the code from the Default.page template in Visual Web Developer Express
  • An explanation of the code in the Default.page template
  • Viewing the code for the Text / HTML module settings
  • Viewing the settings for the Text / HTML module in the localhost installation
  • Explanation of the ‘easy’ method to create page templates
Time Length: 7min 12 secs

Video 2 - The simple method for creating a page template

  • Creating a portal
  • Delete all of the default modules
  • Add a Text / HTML module
  • Configuring the module exactly as we require for the page template:
    • Title, Permissions, Header and Footer text, Visibility, Allow Print, Module Container, Cache Time
  • Adding default text for the Text / HTML module
  • How to export the portal template with the Text / HTML module content
  • Locating the exported portal template file
  • Opening the PageTemplateExample template file in Visual Web Developer Express
  • Explanation of the code that we need to extract to create a page template
Time Length: 7min 44secs

Video 3 - Completing your first page template

  • Creating a copy of the default.page template
  • Removing the Text / HTML module code from the page template
  • Copying the required code from the portal template to the page template
  • Removing the module id from the page template
  • Creating a new page using the new page template
  • Demonstration that all content and module settings have been created
Time Length: 5min 56secs

Video 4 - A complex page template with multiple modules

  • Creating a second page template which uses links, text / html, documents, account login modules in different content panes using different containers and module settings.
  • Viewing the child portal that we previously created
  • Adding and configuring the required modules for the page template
  • How to create the portal template for the new modules and their content
  • Opening the new Links_Text_Documents_Login portal template in Visual Web Developer Express
  • Locating the Home page content and the panes tag
  • Explanation of the module content in the various panes
  • Creating a copy of the Default.page template (Links_Text_Docs_Login.page template)
  • Opening the new page template in VWD Express
  • Removing the default code from the new page template
  • Copying and pasting the required code from the portal template file
  • Remove any references to moduleID from the new page template file
  • Creating a new page using the new page template
  • Demonstration of the new page with each of the modules, content, and their settings included
Time Length: 10min 58secs

Total Time Length: 31min 50secs

You need to Subscribe as a member of DNN Creative Magazine and Login to download this video tutorial.

DotNetNuke Modules
RSS Feeds