New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the Community Exchange, where community members ask and answer questions about DNN. To get started, just start typing your question below and either select one of the suggested questions or ask a new question of your own.

Custom module with possibility to add modules into module to create an expander module in DNN 9.2

Return to previous page

  • 7/18/2018
  • 1785 Views

Question:

Christopher Wolf 6 years ago

I'm using DNN 9.2 and searching for a possibility to create an own module that will work like the Atlassian Confluence's Expander Macro where I could add additional content.

In my case I want to add other modules, which will be visible if the parent is expanded and hidden if the parent is collapsed.

I thought about to use a Pane control in my module to place several other modules into it. It is an approach that targets the Evoq's Grid module functionality, but with the possibility to collapse and expand its content, because of no such (expander) module already exists.

I already tried to achieve it by adding a Pane control from DotNetNuke.UI.Skins namespace in Page_Load method and calling pane.ProcessPane(). As I can see in database a added modul by moving it into out custom module is related to our pane which is located in our module.

Actually I have some problems by loading and rendering the page, because the module is located under and not in our module.

Following is my actual code:

In *.ascx file:

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="View.ascx.cs" Inherits="Prototype.View" %>

<div ID="TestModuleDiv" runat="server"></div>

In *.ascx.cs (code behind file):

using System;

using System.Web.UI.HtmlControls;

using DotNetNuke.Entities.Modules;

using DotNetNuke.UI.Skins;

protected void Page_Load(object sender, EventArgs e)

{

var paneName = "MyTestPane" + ModuleContext.ModuleId;

var paneControl = new HtmlGenericControl("div");

paneControl.ID = paneName;

TestModuleDiv.Controls.Add(paneControl);

var paneId = paneControl.ClientID.Replace("dnn_", "");

PortalSettings.ActiveTab.Panes.Add(paneId);

var pane = new Pane(paneId, paneControl);

pane.ProcessPane();

}

Does somebody have some more information how I could achieve my wanted behavior?

Custom module with possibility to add modules into module to create an expander module in DNN 9.2

Christopher Wolf
Christopher Wolf 6 years ago
Add an Answer

Answers

Sign In to Participate
Or register to become a member