Is there a way to count the visible modules in a specific pane on from the current page context?
I know in theory I could write a joined sql statement, but DotNetNuke offers a variety of objects that support this kind of operation.
This is for a DNN 4 site, but any hint also for DNN 5 is greatly appreciated.
Even the information if there is any module in the pane at all would help.
You can get the modules in a tab with ModuleController.GetTabModules()
The keys of the dictionary are ModuleIDs and the values are ModuleInfo objects. You can also call the corresponding stored procedure
GetTabModulesto retrieve module data.Now,
ModuleInfohas aPaneNameproperty that you would use to group the results, say, to another dictionary, and retrieve the counts from there:You probably also want to filter out the deleted modules:
A list of distinct PaneNames for a tab can be retrieved with the stored procedure
GetTabPanes. The corresponding method in the 4.9.5 codebase is implemented in the DataProvider: