views:

7

answers:

1

Sorry for lame question but I am literally starting with DNN.

When you are in admin/design mode you can list all modules used, and when you click on module at the end you will see the list of controls used in this module with info about filename of the source.

The problem I have is in reverse -- I already know the filename with source, I would like to list all modules which use this control. How to do it?

+2  A: 

If you want to find module definitions with a control, use a query like

SELECT *  
FROM 
ModuleDefinitions md
INNER JOIN ModuleControls mc on (mc.ModuleDefID = md.ModuleDefID)
WHERE ControlSrc like '%filename%'

If you want to find the modules that are actually used, you'll have to join with Tabs, TabModules and Modules tables. For example:

SELECT
t.PortalID
,t.TabID
,t.TabName
,m.ModuleID
,md.FriendlyName
,mc.ControlSrc
FROM 
Tabs t
INNER JOIN TabModules tm ON t.TabID = tm.TabID
INNER JOIN Modules m on tm.ModuleID = m.ModuleID
INNER JOIN ModuleDefinitions md ON m.ModuleDefID = md.ModuleDefID
INNER JOIN ModuleControls mc on mc.ModuleDefID = md.ModuleDefID
WHERE ControlSrc like '%filename%'
mika
Works like a charm, thank you. Pity DNN does not include this in GUI mode, as for listing controls per modules.
macias