The Mighty Blog

Jan25

Written by:Will
1/25/2009  RssIcon

This is actually a topic that has been spoken about before. I am blogging about it now because it has not been spoken about in a while.

Did you know that you can set a default container for a skin pane?  Meaning, when someone adds a module to the page, it will automatically pickup the specified container even the Page or Site Settings say otherwise.

What does that mean to you?  Think of any of the times that you might have built a skin with panes that either have specific widths or color scheme that expects only a container that matches those restrictions.  Now, do you remember having to train the users/admins on which panes that have to be used and why?  How about support calls to remind them why the skin design broke, because they put one of the other containers in the wrong pane?

All that goes by the way side when you set a default container for each pane.  When someone adds a module to the pane, it automatically gets assigned the correct container.

First of all, you are probably already doing something like this in your existing HTML or ASCX skins:

<div id="ContentPane" class="somecssclass" runat="server"></div>

Implementing default containers is surprisingly simple.  All we need to do is add a few more attributes to the previous HTML code. 

For our example, lets consider a scenario.  Let's pretend that we have a content pane that only intends to have containers that are 500 pixels wide.  Let's assume that we have a container named "Title_500pxWide.ascx" to accomplish this.  Once you do, your new HTML snippet will look something like this:

<div id="ContentPane" class="somecssclass" runat="server" ContainerType="L" ContainerName="SkinName" ContainerSrc="Title_500pxWide.ascx"></div>

It is important to know what these new attributes are and what they do.  Here they are listed for you:

  • ContainerType - (L or G) L is for skins installed in the Admin Menu, and G is for skins installed in the Host Menu.
  • ContainerName - This is the name of the skin, and also the name of the zip file used to install the skin.
  • ContainerSrc - This is the name of the container file, once it is parsed into a Server Control.

It is important to note that if you specify your containers using L (for Admin), and the Admin installs the skin package in the Host Menu, the specified container will not be found.  In turn, it will not be shown, and whatever is set in the Admin or Page settings will be used.

Also, if you specify a different container in the Module Settings, that will be the container that is used.  The default in the skin will be overridden, but only for that module.

That's it!  This example will work for any pane, on any skin.  Even DotNetNuke 5 skins.  Give it a try!  You'll never look back.

Technorati Tags: , , , ,

Copyright ©2009 Will Strohl

2 comment(s) so far...


Gravatar

Thanks again, Will! You came through when I needed it!

By Ralph Williams on   10/16/2009
Gravatar

I am happy to help, of course. :)

By Will on   10/16/2009

Your name:
Gravatar Preview
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Comment:
Security Code
CAPTCHA image
Enter the code shown above in the box below
Add Comment   Cancel 
Add to Technorati Favorites
Tweet about my blog
Will Strohl - The Mighty Blog - RSS Feed

Tag Cloud

Sort by:Tag | SizeRSS
camp   community   dnn   dotnetnuke   dotnetnuke®   event   example   free   get   group   integer   jquery   meeting   module   odug   orlando   search   session   think   use  
The opinions expressed here are the personal opinions of Will Strohl and do not necessarily represent the views and opinions of the DotNetNuke Corporation.
© Copyright 2004-2010 by Will Strohl. All rights reserved.Website Skinned By: Ralph Williams  Website Hosted By: Applied Innovations