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?