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

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Change Module (Container) TitleChange Module (Container) Title
Previous
 
Next
New Post
12/13/2011 1:24 PM
 
Works in int and load. Tested in both!

Leigh Pointer
User Group Champion [World Wide]
» Evangelising DotNetNuke Everywhere «

Nederlandstalige DotNetNuke Gebruikersgroep Subzero Solutions ARC for DotNetNuke Design is the craft of visualising concrete solutions that serve human needs and goals within certain contraints. Visulising concrete solutions is the essence of design.
 
New Post
12/13/2011 4:50 PM
 

Leigh,

Timing is everything! I spent an interesting hour or so testing both your method and my revised one to determine at what point in the page life-cycle the displayed module title could be altered from within a module control's code. In DotNetNuke 4 and 5 (not sure about 5.6.3), my :"hack" was necessary as the text of the DNN container title object was getting set from the ModuleConfiguration.ModuleTitle property during the title object's Page_Load event. Simply changing the value of ModuleTitle any later than a module control's Page_Init event would be too late in the life-cycle hence the need for the brute-force hack.

In DNN 6.x (and late 5.x) there were many core changes in the way pane, container and module injection was done. In addition to changing the control ID for the dnnTitle control in the Title.ascx container object, the setting of title lable's Text property from the ModuleTitle property is now (and more correctly so) delayed until the Title object's PreRender event. That's good news in that it allows a module control to very simply alter it's displayed title using code such as yours (or the equivalent ModuleContext.Configuration.ModuleTitle = "My New Module Title") during handling of it's Page_Init, Page_Load, and control post-back events - any time up to the PreRender event. Now, if you do need to change the displayed title during PreRender handling you will still have to use my "hack" - but I can't think of any reason why you would have to wait until PreRender.

So, in short for DNN 6.x,  use Leigh's code to change a displayed module title "on the fly".


Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
New Post
12/27/2011 5:54 PM
 
I tried Leigh's code in v. 6.1.2 and it wasn't working as ModuleConfiguration.ModuleControl.ControlTitle was empty... but what DID work (on Page_Load) is:

ModuleConfiguration.ModuleTitle = "hello world";


Andrew Walker

Learn to make your own beer and wine at homeIf you enjoy making your own beer and/or wine - be sure to check out http://www.ForemostBrewing.com
 
New Post
12/28/2011 1:41 AM
 

This is working in my module that is deployed to 6.1.2 DNN instatance,

Page_Init(object sender, System.EventArgs e)
{
    jQuery.RequestDnnPluginsRegistration();
    //Inbox
    if (JotterID == 0) {
        ModuleConfiguration.ModuleControl.ControlTitle = GetLocalizedString("Inbox");
    } else if (JotterID != Null.NullInteger) {
        //Get the Title
        JotterController JotterControl = new JotterController();
        ModuleConfiguration.ModuleControl.ControlTitle = JotterControl.GetJotter(JotterID, ModuleId).Name;
    }
}

Leigh Pointer
User Group Champion [World Wide]
» Evangelising DotNetNuke Everywhere «

Nederlandstalige DotNetNuke Gebruikersgroep Subzero Solutions ARC for DotNetNuke Design is the craft of visualising concrete solutions that serve human needs and goals within certain contraints. Visulising concrete solutions is the essence of design.
 
New Post
12/28/2011 11:20 AM
 

Hi Leigh - there's something goofy going on here ;)

In one Module I've build (WebFormsMVP) - I see where if I try to use:
ModuleContext.Configuration.ControlTitle  - It says it's depricated as of DNN 5.0 and to use ModuleControl.ControlTitle - just as you've stated and it works.  I am running and referencing DNN 5.6.2 in this module. 

BUT... we're talking about dnn 6.x - and this (Below) is where I'm not sure why you and I are getting different results.

In another module (Not MVP) I am referencing DNN 5.4.4 (for backward compatibility - this module is used in different installs) - and I have to use 2 different approaches to get the Module Title to work - neither are ModuleControl.ControlTitle -- it's always empty for some reason. (FYI - in my module I have a token that get's replaced - so [CITY] is either replaced w/ a city name or it's just removed)

Also in this Module - I had to use check the DNN Version Major because one approach won't work on both. If it was < 6 - I still use Bill Severance's code otherwise I have to use ModuleConfiguration.ModuleTitle as this contains my ModuleTitle w/ the token that needs to be replaced (In DNN 6.x)

Just wonky... I'll post my code next.



Andrew Walker

Learn to make your own beer and wine at homeIf you enjoy making your own beer and/or wine - be sure to check out http://www.ForemostBrewing.com
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Change Module (Container) TitleChange Module (Container) Title


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