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

HomeHomeDevelopment and...Development and...Getting StartedGetting StartedMultiple views for one moduleMultiple views for one module
Previous
 
Next
New Post
2/9/2012 1:19 PM
 
you just need to redirect to the approriate page, and the view control of the module will be loaded.

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
2/9/2012 5:40 PM
 

What we usually do for complex module systems that need to be able to redirect to each other - is set up some global portal settings.

Create a settings.ascx based on ModuleSettingsBase for one of your modules - and wire it up as the settings view for that module.

Add dropdown or just a text field to the settings page - so that you can either just enter a tabid or select from a list of available pages - the page you want to be able to redirect to.

In the UPDATESETTINGS event for ModuleSettingsBase pages all you then need to do to store a setting that can be accessed system wide is something like :

PortalController.UpdatePortalSetting(PortalId, "MyModule_SalesTabid", txtSalesTabid.Text);

From in each of your modules you can then access this setting whenever you need it

String salesTabId = PortalController.GetPortalSetting("MyModule_SalesTabid", PortalId, "-1");
Int32 intSalesTabId = Int32.Parse( salesTabId);
Response.Redirect(Globals.NavigateURL(intSalesTabId), true) 

Westa



 
New Post
2/10/2012 4:16 AM
 

Thanks Wes that seems like what I was looking for.

But one step further, if I know there should be only one instance of my other module on the portal, maybe I can do a request like that :

select tm.TabID from ModuleDefinitions md
inner join dbo.Modules m on md.ModuleDefID = m.ModuleDefID
inner join dbo.TabModules tm on tm.ModuleID = m.ModuleID
where md.FriendlyName = @ModuleName

Get the TabId and redirect there. Does that seems correct to you ? This way, I don't have the global portal settings. Or maybe there are some built-in methods to do that ?

 
New Post
2/12/2012 5:45 AM
 

Ok - yes while it is possible to access information about a  dnn portal directly via SQL - it is something that should be steered clear of where possible.

Instead you would be better off taking advantage of the DNN API for doing this sort of access - one of the things about DNN is that the core sql structure can and does evolve over time - whole tables have been updated / replaced in the past leaving sites that use direct sql coding totally non-functioning.

Have a look at the DotNetNuke.Entities.Modules.ModuleController api for this sort of thing

GetModuleByDefinition( )  returns a moduleinfo record for the first Module found in the site by friendly name - on the assumption that you KNOW there is only ONE instance of the module on the site.

GetModulesByDefinition() to retrieve an arraylist of moduleInfo records - for when there are possibly more than one instance of a module.
One of the things to also understand about the api is that in MANY cases the api is actually not even hitting the database - much of the core of a dnn site is managed internally by a cache controller - which holds lots of key system elements.

Westa


 
New Post
2/13/2012 4:07 AM
 

 

Thanks, I was hoping there would be something in the API, I'm going to go this way.

Where can I find the documentation for this API ? I've looked at many places but did not find an up-to-date doc

In here, most of the doc is from 2006, isn't there some automatic documentation generated from the code comments somewhere ?

Cheers

 
Previous
 
Next
HomeHomeDevelopment and...Development and...Getting StartedGetting StartedMultiple views for one moduleMultiple views for one 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