• Share
    • Twitter
    • LinkedIn
    • Facebook
    • Email
  • Feedback
  • Improve this Doc
Show / Hide Table of Contents

Create a Container

DNN Version: 09.02.00
12/08/2019 • 2 minutes to read
Contributors  david-poindexter
12/08/2019  • 2 minutes to read  • Contributors  david-poindexter

A container is similar to a layout template, except a container's scope is modules, whereas a template's layout (formerly Skin) scope is the entire page. A container is essentially a wrapper for a module and can be used to style it's content or add other functionality (advanced use cases).

Containers allow designers to seamlessly integrate modules from many different developers into a cohesive website design. Containers can also include visual elements that allow website users to interact with the module.

  • You can have a default container, which would be overridden by individual panes or modules if they provide their own style definitions.
  • You can use different containers in a single page.
  • You can mix and match any container with any CSS.

Prerequisites

A local DNN installation with Host permissions.

Steps

  1. Create a new file for the container.

    Note
    • The container must contain exactly one pane called ContentPane.
    • The single pane must be defined as a server control by adding runat="server" to the element.
    • A pane can be one of the following HTML elements: <td> (table cells), <div>, <p>, and <span>.
    • (Optional) You can add the attribute visible="false" to the pane to prevent it from being displayed if no module is assigned to it.

    A very basic container in HTML.

    
        <div id="ContentPane" runat="server"></div>
    
    

    A very basic container in ASCX.

    
        <%@ Control AutoEventWireup="false" Explicit="True" Inherits="DotNetNuke.UI.Containers.Container" %>
        <div id="ContentPane" runat="server"></div>
    
    
  2. (Optional) Add theme objects to your container for a more dynamic page.

    The following theme objects are relevant to containers:

    ACTIONBUTTON Displays an action from the module action menu.
    DROPDOWNACTIONS Displays the module action menu as a dropdown list.
    ICON Displays the module icon.
    PRINTMODULE Displays a link for the Print action from the module action menu.
    TITLE Displays the module title.
    VISIBILITY Displays a visibility control for the module allowing users to show or hide a given module on the page.
Theme ObjectsAbout ThemesCreating Themes
DNN Wiki: DotNetNuke SkinsDNN Community blog: DotNetNuke Skinning 101 (Part 3) by Joe BrinkmanDNN Professional Training: Creating HTML SkinsSkinning Tool / Online Reference for DNN Skins & Container Objects by 10 Pound Gorilla
Back to top by the community, for the community... #DNNCMS