-
-
In our Engage: Publish module we load quite a few different user controls depending on who you are, and what you have access to.
One of the controls we add is an admin menu. All along we've loaded the control everytime the other controls load, assuming you are logged in as either an Admin or an Author. One thing we wanted to do for the 4.3.7 release was to hide that Admin control if you were in the "VIEW" pagemode for DotNetNuke, rather than the "EDIT" pagemode.
I tried a few different things, but it ended up being far simpler than I had expected. Where I was checking to see if a user was in the proper roles, I simple added a new check, if (IsEditMode)
It was that simple, so if you need to control your pages with different information based on the VIEW/EDIT radio buttons in DotNetNuke, just be sure to check for IsEditMode.
One note, the above is all assuming that your modules/controls are inheriting from PortalModuleBase, as IsEditMode resides in there.
-
-
This is actually a very simple trick to do inside of your modules, though you might need to setup an option to allow this to be turned on or off depending on what the site administrator wants the page title to be.
In C# you can use the following code
DotNetNuke.Framework.CDefault tp = (DotNetNuke.Framework.CDefault)this.Page;
tp.Title = "This is my page title";
So the next time you're coding a module and need to change the page title, it's that simple.
See you all at OpenForce07 in Vegas!