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...ovveride the injectModule functionovveride the injectModule function
Previous
 
Next
New Post
10/9/2008 6:51 AM
 

Hi!

I have to do a small change in the InjectModule method in the class DotNetNuke.UI.Skins.Skin. I have written a new class that inheritate the skin class. This is where I want to override the injectmodule.

ex:
public override void InjectModule(Control objPane, ModuleInfo objModule, DotNetNuke.Entities.Portals.PortalSettings PortalSettings) {
            base.InjectModule(objPane, checkNumberOfModulesInPane(objModule), PortalSettings);
 }

I have to make a small change in the DotNetNuke framework to make InjectModule overridable, and I do not want to make changes there because of upgrades.

What I try to do in checkNumberOfModulesInPane is if I have two modules in a Pane force it to use some other containerSrc than if there is only one module in a Pane.

ex:
public  ModuleInfo checkNumberOfModulesInPane(DotNetNuke.Entities.Modules.ModuleInfo module)
        {
            if (module.PaneModuleCount > 1)
            {
                if (module.PaneModuleIndex == 0)
                {
                    module.ContainerSrc = "Advis_B_Left.ascx";
                }
                else
                {
                    module.ContainerSrc = "Advis_B_Right.ascx";
                }
            }
            else
            {
                module.ContainerSrc = "Advis_A.ascx";
            }
            return module;
        }

Finally my question. Is it possible to do this without making the InjectModule overridable?

 
New Post
10/9/2008 9:14 AM
 

Hi Magne,

My inclination is that this sort of behavior would be possible with some sophisticated container logic that would detect the context and style itself accordingly.  Such a container would alleviate the need for any core changes.

I would otherwise strongly recommend against modifying the core for these sorts of hardcoded modifications.

Brandon


Brandon Haynes
BrandonHaynes.org
 
New Post
10/10/2008 2:11 AM
 

Thnks for putting my brain into a new direction of thinking. I will investigate the possibillities in the container logic. I agree that changing the core is not a good idea.

Magne

 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...ovveride the injectModule functionovveride the injectModule function


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