Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

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 DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Hiding a Module Hiding a Module
Previous
 
Next
New Post
2/28/2014 10:39 AM
 

Is it possible to hide a module like one hides a div?

I am using the Digital Asset Management module on a page (this has it's own problems in that the configuration settings for restricting the module to a certain folder doesn't work) but after my user uploads a file, I would like them to push the continue button and have the module hidden.

Tucking the module in a div seems to be an impossibility. I can see the divs that wrap the module in the module's code but I can't address them from my code behind. This seems the most logical way but my .cs file is not aware of the module at the time the page is loaded.

 Any help is greatly appreciated!

Thanks,

Chris

 
New Post
2/28/2014 10:52 AM
 
typically to do this you would use a wizard control, or else some javascript to hide the module containing div -another option if you want to handle it server side is to use the imoduleinjectionfilter (http://www.dnnsoftware.com/community-...)

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
2/28/2014 3:32 PM
 

Here's the solution I came up with. I needed to put the Digital Asset Management module on a page, have the user upload a file and then hide the module when the user was done. I start with the module hidden and expose it when the user makes a choice to upload a file. This code is contained in the .ascx file:

<%
int PortalId = PortalController.GetCurrentPortalSettings().PortalId;

//first, we need to get the tabID of the current page:
string PageTabId;
DotNetNuke.Entities.Tabs.TabInfo objTab;
DotNetNuke.Entities.Tabs.TabController objTabs = new DotNetNuke.Entities.Tabs.TabController();
objTab = objTabs.GetTabByName("Album Entry", PortalId); //"Album Entry" is the name of my page
PageTabId = objTab.TabID.ToString();

//next, we'll query the db for our module's ID on the page:

var conString = ConfigurationManager.ConnectionStrings["SiteSqlServer"];
string strConnection = conString.ConnectionString + ";MultipleActiveResultSets=True";
SqlConnection cn = new SqlConnection(strConnection);
cn.Open();

string strSQL = @"select tm.ModuleID
from [dbo].[TabModules] tm
where tm.TabID = '" + PageTabId + @"'
and tm.ModuleTitle = 'AE-Digital Asset Management'"; //"AE-Digital Asset Management" is the title I gave the module

SqlCommand cmdGetModule = new SqlCommand(strSQL, cn);
SqlDataReader rsTabs = cmdGetModule.ExecuteReader();
rsTabs.Read();

//DNN modules all seem to have a standard naming convention -- ddn_ctr<ModuleID>_ModuleContent

string DAMDivID = "dnn_ctr" + rsTabs["ModuleID"].ToString() + "_ModuleContent";

%>

<%--finally, hide the div using a javascript%>
<script type="text/javascript">
document.getElementById('<%=DAMDivID%>').style.visibile = "hidden";
document.getElementById('<%=DAMDivID%>').style.display = "none";
</script>

 

If you need to have the same module multiple times on a page, simply give it a unique title for each occurrence.

If anyone has any suggestions or comments, by all means, let me know. I hope someone finds this useful.

Chris

 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Hiding a Module Hiding a Module


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out