Sunday, March 20, 2005
by Nik Kalyani
Sunday, March 20, 2005 12:49:43 PM (Pacific Standard Time, UTC-08:00)

The DotNetNuke Control Panel is generally positioned at the top of a page (although it can be positioned anywhere). It is displayed if a user has administrative rights to a page. After the initial layout of a page, the Control Panel is not often needed, but it continues to take up valuable screen real-estate. I saw a recent discussion on this issue in the ASP.net forums, and decided that it presents an interesting U.I. challenge. (Turns out it really isn’t much of a challenge.)

At Bryan Andrews’ suggestion, I had actually developed a script modeled after the Windows Terminal Services Client collapsible admin bar some months back. The bar is visible at the top, but rolls up after a few seconds. I posted the script to the Core Team forum, but unfortunately, there was no interest.

Anyway, getting back to the Control Panel solution. I like the Terminal Services client concept and modeled my solution after it. One of my design goals was to keep things really simple and not require any external images or the like.

My solution works as follows:

1) My script block needs to be inserted into any DNN skin, replacing the existing element with id=”ControlPanel”

2) It renders the Control Panel at the top of the page (coordinates 0,0). The Control Panel is initially hidden and is represented by a 5px tall red bar.

3) Move your mouse over the bar and the Control Panel is displayed over page content. This is an important difference from the standard Control Panel as the page content remains in place and does not scroll down.

4) When the mouse cursors is moved over the red bar one more time, the Control Panel smoothly rolls up.

Here is the code. Just paste it into a DNN skin ascx file, taking care to replace the element with id=”ControlPanel” that should already be present in the file.

<!-- Begin collapsible Control panel code -->

<script language="Javascript">

var rollUp = false;
function collapseElement(objId)
{
   o = document.getElementById(objId);
   h = parseInt(o.style.height);
   if (h > 6)
       {
           h--;
           o.style.height= h + "px";
           window.setTimeout("collapseElement('" + objId + "')",5);
       }
   else
       rollUp = false;
}


function displayElement(height)
{
    obj = document.getElementById("<%= ControlPanel.ClientID %>");

    if (rollUp)
       collapseElement("<%= ControlPanel.ClientID %>");
    else
    {
       rollUp = true;   
         obj.style.height = height;
    }
}
</script>

<style>

.ControlPanelHeader
{
        height:5px;
        width:100%;
        background-color:#cc0000;
        padding-top:5px;
        overflow:hidden
}

.RollUpControlPanel
{
         position:absolute;
        top:0px;
        left:0px;
        z-Index:1000;
        height:5px;
        width:100%;

        overflow: hidden;
}

</style>

<div class="RollUpControlPanel" id="ControlPanel" runat="server">
<div class="ControlPanelHeader" onmouseover="displayElement('110px')">&nbsp;</div>
</div>

<!-- End collapsible control panel code -->

 

#    Comments [7] - Trackback    

DotNetNuke | Javascript

Tracked by:
"discover card" (discover card) [Trackback]
Sunday, March 20, 2005 11:08:34 PM (Pacific Standard Time, UTC-08:00)
nik,

This is great !!!

Do you have any example Skin posted somewhere ?
Jaydeep Bhatt
Monday, March 21, 2005 12:06:18 AM (Pacific Standard Time, UTC-08:00)
Ok, nik

I have tested you script, it just works fine

(why was it not included in DNN 3.0.12 as a part of the Skinning Engine, with Some API ?)

The only thing I suppose, which can be added is

if there is no movement over the Control panel, say for about 1 min (60 sec or 60,000 msecs) then the Control Panel should rollup by itself. I guess that should be easy to do, right ?

Thanks for the Script
Jaydeep Bhatt
Tuesday, March 29, 2005 10:18:59 AM (Pacific Standard Time, UTC-08:00)
I tested this script also, and it is great! I do find that I have a tendancy to run my cursor over it unintentionally a lot with skins that have menus close to the top of the page. It would be great if there was a way to make it only pop up After say 4 or 5 seconds of hovering over the bar, and the same with rolling the bar up. It would also be great if there was an optional way to turn off the hover, and just act on clicks to the bar...

As always - great stuff! Keep up the excellent work!

Saturday, April 09, 2005 10:28:05 AM (Pacific Standard Time, UTC-08:00)
Great addition for the Control Panel. The problem is that when I am not logged in as an Admin or Superuser account you can still see the red bar accross the top.

How can I get it so that this is not shown when not logged in as an Admin or Super User?

Ken
Ken
Sunday, May 01, 2005 7:50:28 AM (Pacific Standard Time, UTC-08:00)
I agree that this is an excellent enhancement to DNN. However, I concur with Ken, for this to be readily used, we'd need to find a way to hide the red bar when an admin user is not logged on.

Anyone know how to do this?
Friday, June 24, 2005 5:25:29 AM (Pacific Standard Time, UTC-08:00)
I posted a fix for the red bar situation on Nik's Skinergy forums section and also at:

http://forums.asp.net/967794/ShowPost.aspx
Wednesday, March 15, 2006 1:42:18 AM (Pacific Standard Time, UTC-08:00)
Is there anyway I can hide this panel from portal administrators? I dont want admins to change layouts.
Haris
Name
E-mail
(will show your gravatar icon)
Home page

Comment (Some html is allowed: a@href@title, b, i, u) where the @ means "attribute." For example, you can use <a href="" title=""> or <blockquote cite="Scott">.  

Enter the code shown (prevents robots):

Live Comment Preview
RSS feed
Search and Links
Bling

View Nik Kalyani's profile on LinkedIn

Contact me: nik*kalyani.com (replace "*")

TechBubble
www.flickr.com
This is a Flickr badge showing public photos from techbubble. Make your own badge here.
Statistics
Total Posts: 214
This Year: 32
This Month: 0
This Week: 0
Comments: 238
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2008
Nik Kalyani
Sign In
All Content © 2008, Nik Kalyani