﻿<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Jon Henning</title>
    <description>My personal blog on DotNetNuke.</description>
    <link>http://www.dotnetnuke.com/Products/Development/Forge/CoreWebControls/tabid/873/BlogId/8/Default.aspx</link>
    <language>en-US</language>
    <managingEditor>jon.henning@dotnetnuke.com</managingEditor>
    <webMaster>admin1@dotnetnuke.com</webMaster>
    <pubDate>Sat, 17 May 2008 07:08:16 GMT</pubDate>
    <lastBuildDate>Sat, 17 May 2008 07:08:16 GMT</lastBuildDate>
    <docs>http://backend.userland.com/rss</docs>
    <generator>Blog RSS Generator Version 3.4.0.39853</generator>
    <item>
      <title>Introducing DNNMultiStateBox</title>
      <description>&lt;p&gt;One of the new features coming in Cambrian is an update in the permissions grid.&amp;#160; The current grid supports two states, Allow and Null (not assigned).&amp;#160; The new grid will support three states (Allow, Deny, and Null).&amp;#160; The obvious question here is how do you present this to the user?&amp;#160; The current design allows for a nice compact way to set the permissions within a grid utilizing checkboxes.&amp;#160; The new way will use a new DotNetNuke WebControl that supports multiple states and mimics a checkbox.&amp;#160; The original name I came up with for the control was DNNTriStateCheckbox.&amp;#160; However, while developing this control I soon realized there was no reason I needed to only support 3 states and saw the opportunity to support any number of states and not necessarily look like a checkbox.&amp;#160; So the control is now called DNNMultiStateBox.&amp;#160; It is probably the simplest of all the controls in the &lt;a href="http://webcontrols.dotnetnuke.com/&amp;</description>
      <link>http://www.dotnetnuke.com/Products/Development/Forge/CoreWebControls/tabid/873/EntryID/1835/Default.aspx</link>
      <comments>http://www.dotnetnuke.com/Products/Development/Forge/CoreWebControls/tabid/873/EntryID/1835/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.dotnetnuke.com/Default.aspx?tabid=873&amp;EntryID=1835</guid>
      <pubDate>Mon, 12 May 2008 06:00:00 GMT</pubDate>
      <slash:comments>9</slash:comments>
      <trackback:ping>http://www.dotnetnuke.com/DesktopModules/Blog/Trackback.aspx?id=1835</trackback:ping>
    </item>
    <item>
      <title>Minor Perf Optimization to Caspian Release</title>
      <description>&lt;p&gt;While sitting at the airport waiting for my plane to depart to the &lt;a href="https://www.mvpsummit2008.com/"&gt;MVP Summit&lt;/a&gt;, I decided to spend a little time optimizing the new ClientAPI (codenamed Caspian) for the Cambrian release.&amp;#160; One of the new features for this release was to allow the output of the ClientAPI and Webcontrols to emit compliant markup (more detail mentioned in &lt;a href="http://www.dotnetnuke.com/Community/Blogs/tabid/825/EntryID/1532/Default.aspx"&gt;this blog&lt;/a&gt;).&amp;#160; There was two areas that this affected my code.&lt;/p&gt;</description>
      <link>http://www.dotnetnuke.com/Products/Development/Forge/CoreWebControls/tabid/873/EntryID/1801/Default.aspx</link>
      <author>jon.henning@dotnetnuke.com</author>
      <comments>http://www.dotnetnuke.com/Products/Development/Forge/CoreWebControls/tabid/873/EntryID/1801/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.dotnetnuke.com/Default.aspx?tabid=873&amp;EntryID=1801</guid>
      <pubDate>Mon, 14 Apr 2008 06:00:00 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.dotnetnuke.com/DesktopModules/Blog/Trackback.aspx?id=1801</trackback:ping>
    </item>
    <item>
      <title>Javascript Global Namespaces (the dreaded $ function)</title>
      <description>&lt;p&gt;&lt;em&gt;The whole idea of the $ function and who "owns" that "namespace" has become quite muddy.&amp;#160; When I first learned of the use of $ and found that MS was adopting the same notation, I decided to do it as well.&amp;#160; For at the time, I felt that all frameworks simply used it as a quick way to get the reference to a DOM element.&amp;#160; Soon afterwards I learned that frameworks like prototyle use it for much more.&lt;/em&gt;&lt;/p&gt;</description>
      <link>http://www.dotnetnuke.com/Products/Development/Forge/CoreWebControls/tabid/873/EntryID/1776/Default.aspx</link>
      <author>jon.henning@dotnetnuke.com</author>
      <comments>http://www.dotnetnuke.com/Products/Development/Forge/CoreWebControls/tabid/873/EntryID/1776/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.dotnetnuke.com/Default.aspx?tabid=873&amp;EntryID=1776</guid>
      <pubDate>Mon, 24 Mar 2008 08:00:00 GMT</pubDate>
      <slash:comments>3</slash:comments>
      <trackback:ping>http://www.dotnetnuke.com/DesktopModules/Blog/Trackback.aspx?id=1776</trackback:ping>
    </item>
    <item>
      <title>Searching for the "Holy Grail" of Menu Item Customization</title>
      <description>&lt;p&gt;For a long time now many skinners for DotNetNuke have felt like customizing individual menu items was like &lt;a href="http://www.dotnetnuke.com/Community/Forums/tabid/795/mid/2108/forumid/109/threadid/149710/scope/posts/Default.aspx#149710"&gt;looking for the Holy Grail&lt;/a&gt;.  All the menus I have contributed to the community (Solpart and DNNMenu) have always had the ability to customize each menu item.  The problem always was&lt;br /&gt;
how do we allow DotNetNuke the ability to customize the items?  The only place the unique menu structure is known is after the portal is created, well out of reach of someone providing a generic skin to fit any site.  Sure there are those portal admins out there that know enough about css to make it work, but there still was a problem in how to access each item directly in css.&lt;/p&gt;
&lt;p&gt;I have been &lt;a href="http://www.dotnetnuke.com/Products/Development/Roadmap/tabid/616/ctl/Details/mid/3582/enhancementid/2/Default.aspx"&gt;considering options&lt;/a&gt; for how to overcome this for some time now,  and am currently working on the 2.0 version of the webcontrols which should contain one possible solution.  However, those controls are far from complete so I decided to offer a minor hack along the same lines.&lt;/p&gt;
&lt;p&gt;First, let us consider &lt;a href="http://www.dotnetnuke.com/Community/Forums/tabid/795/mid/2108/forumid/109/threadid/149710/scope/posts/Default.aspx#149710"&gt;eclayf's idea from the forums&lt;/a&gt;, where I borrowed the name of this blog entry from.  The idea is to loop through all menu items and assign a background image to each item based off of the icon assigned.  This allows the background image to be customized by the portal admin.&lt;/p&gt;
&lt;p&gt;To try this idea out add the following code to your ascx page using the DNNMenu (not solpart).  I tested with default blue for DNN.&lt;/p&gt;
&lt;pre&gt;&lt;script type="text/javascript"&gt;
    function setupMenuImageCss(id)
    {
       var menu = dnn.controls.controls[id + '_ctldnnNAV'];
       assignImageCss(menu, menu.rootNode);
    }
    
    function assignImageCss(menu, parent)
    {
	    var menuNode = new dnn.controls.DNNMenuNode(parent);
	    var iconCtl = menu.getChildControl(menuNode.id, 'icn');
	    if (iconCtl)
	    {
	        iconCtl.style.display = 'none'; //hide icon
		    var menuCtr = menu.getChildControl(menuNode.id, 'ctr');
		    menuCtr.style.backgroundImage = "url('" + iconCtl.src + "')";
	    }
	    for (var i=0; i &lt; parent.childNodeCount(); i++)
	    {
		    assignImageCss(menu, parent.childNodes(i));
	    }
    }

    try 
    {
        document.execCommand("BackgroundImageCache", false, true);
    } 
    catch(err) {}
    
&lt;/script&gt;
&lt;script runat="server"&gt;
Private Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.PreRender
        DotNetNuke.UI.Utilities.DNNClientAPI.AddBodyOnloadEventHandler(Me.Page, "setupMenuImageCss('" &amp; dnnNAV.ClientID &amp; "')")
End Sub
&lt;/script&gt;&lt;/pre&gt;
&lt;p&gt;This should cause the icon images to be displayed as the background. &lt;/p&gt;
&lt;p&gt;&lt;em&gt;Note: I noticed that if your skin declares the background-color (as the default blue does), the hover will no longer display the background.  If you change it to not set the background then the image remains.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;While this works, it is far from ideal.  For one thing the admin menu item icons are not customizeable.  Probably the biggest shortcoming is you can only customize the image, which happens to meet eclayf's requirements, but not generic enough to implement for DotNetNuke.&lt;/p&gt;
&lt;p&gt;The idea I have been toying with is allowing the next version of the menu to support known client-side IDs. My current thought is to allow the skin to decide whether to go this route by providing a "safe" known namespace.  For example, in your skin you would have a property like &lt;font face="Courier New"&gt;ClientIDPrefix="jcompany"&lt;/font&gt;, then on the client each node will be assigned a unique id, prefixed with that text.  So the root would be &lt;font face="Courier New"&gt;jcompany__0&lt;/font&gt;, &lt;font face="Courier New"&gt;jcompany__1&lt;/font&gt;, etc.  The child of &lt;br /&gt;
&lt;font face="Courier New"&gt;jcompany__2&lt;/font&gt; would be &lt;font face="Courier New"&gt;jcompany__2_1&lt;/font&gt;, &lt;font face="Courier New"&gt;jcompany__2_2&lt;/font&gt;, etc.   This way it would allow the skinner&lt;br /&gt;
to predefine as many levels as he/she sees fit, and as long as the user of the portal doesn't exceed the predefined number, the skin should work as originally intended.  Even if the skinner doesn't provide the level necesssary (something like &lt;font face="Courier New"&gt;jcompany__2_2_1_3_5&lt;/font&gt;), there is nothing stopping the user from adding the css himself, perhaps copying the value from a class defined higher up.  The only pitfal in this approach is the worry about overlapping prefixes with other controls on the page.&lt;/p&gt;
&lt;p&gt;In order to try this concept out add the following code to you ascx file that uses the DNNMenu&lt;/p&gt;
&lt;pre&gt;&lt;script type="text/javascript"&gt;
    function setupMenuIds(id, prefix)
    {
       var menu = dnn.controls.controls[id + '_ctldnnNAV'];
       assignMenuIds(menu, menu.rootNode, prefix, '');
    }

    function assignMenuIds(menu, parent, prefix, id)
    {
	    var menuNode = new dnn.controls.DNNMenuNode(parent);
	    var menuCtr = menu.getChildControl(menuNode.id, 'ctr');
	    var newId = prefix + '_' + id;
	    if (menuCtr)
		    menuCtr.id = newId;

        for (var i=0; i
&lt;script runat="server"&gt;
Private Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.PreRender
        DotNetNuke.UI.Utilities.DNNClientAPI.AddBodyOnloadEventHandler(Me.Page, "setupMenuIds('" &amp; dnnNAV.ClientID &amp; "', 'jcompany')")
End Sub
&lt;/script&gt;&lt;/pre&gt;
&lt;p&gt;Then in your css file add something like&lt;/p&gt;
&lt;pre&gt;#jcompany__0
{
	background: red;
}

#jcompany__1
{
	background: blue;
}

#jcompany__1_0 td
{
	background: green;
}

#jcompany__1_1 td
{
	background: orange;
}&lt;/pre&gt;
&lt;p&gt;&lt;em&gt;Note:  It is worth noting that in general it is a bad idea to change the ids of a any control, as it most likely will break the control when it does a lookup by its id.  In the DNNMenu's case, those references to the lookup are cached internally, thus this reassignment of ids will work.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Right now this is just an idea I'm toying with. If people like the approach I probably will include it in version 2.0 of the DNNMenu.  Any feedback on this would be welcome.&lt;/p&gt;</description>
      <link>http://www.dotnetnuke.com/Products/Development/Forge/CoreWebControls/tabid/873/EntryID/1487/Default.aspx</link>
      <comments>http://www.dotnetnuke.com/Products/Development/Forge/CoreWebControls/tabid/873/EntryID/1487/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.dotnetnuke.com/Default.aspx?tabid=873&amp;EntryID=1487</guid>
      <pubDate>Wed, 14 Nov 2007 17:43:03 GMT</pubDate>
      <slash:comments>14</slash:comments>
      <trackback:ping>http://www.dotnetnuke.com/DesktopModules/Blog/Trackback.aspx?id=1487</trackback:ping>
    </item>
    <item>
      <title>BETA TEST PROGRAM: ClientAPI/WebControls - DawnTreader and Caspian</title>
      <description>&lt;p&gt;&lt;span class="Forum_Normal" id="spBody"&gt;
&lt;p&gt;The conversion of the ClientAPI and WebControls to utilize the MS AJAX Framework along with emitting xhtml compliant markup is near completion.  It is now time to start testing the backwards compatibility of the conversion.  In order to adequately do this, I am asking for the communities help.  If you are a skinner who uses any of the DotNetNuke webcontrols (DNNMenu, DNNTreeView, etc.) your assistance is needed.  If you are a module developer who uses any portion of the ClientAPI or any of the WebControls, you assistance is also needed. &lt;/p&gt;
&lt;p&gt;Interested in ensuring that your investment in DotNetNuke is backwards compatible?  Follow the instructions in &lt;a href="http://www.dotnetnuke.com/Community/Forums/tabid/795/forumid/76/threadid/176783/scope/posts/Default.aspx"&gt;this thread&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;/span&gt;&lt;/p&gt;</description>
      <link>http://www.dotnetnuke.com/Products/Development/Forge/CoreWebControls/tabid/873/EntryID/1597/Default.aspx</link>
      <comments>http://www.dotnetnuke.com/Products/Development/Forge/CoreWebControls/tabid/873/EntryID/1597/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.dotnetnuke.com/Default.aspx?tabid=873&amp;EntryID=1597</guid>
      <pubDate>Thu, 18 Oct 2007 22:10:23 GMT</pubDate>
      <slash:comments>3</slash:comments>
      <trackback:ping>http://www.dotnetnuke.com/DesktopModules/Blog/Trackback.aspx?id=1597</trackback:ping>
    </item>
  </channel>
</rss>