Register  Login  
  July 29, 2010  
Search_Blog Minimize
Print  

Blog_Archive Minimize
Print  

Blog    
View_Blog Minimize
Jul 30

Written by: host
Thursday, July 30, 2009 10:05 PM 

It seems lately that I have been taking the long way around when attempting to do something involving DotNetNuke.  My latest extended effort was attempting to add a indented dot tab list to my MenuLinks module.  It’s a long story that I will shorten so you can learn the lessons I had to learn the hard way.

It start simply enough, I wanted to add the ability to display any sub-menu within MenuLinks, not just the current page’s relative menu items (Parent, Siblings, or Children).  The module currently uses the tabid of the current page to determine the relative menu position.  I thought that if I allowed the user to supply the starting menu item, the module could easily display any relative menu.  So begins the hunt for the indented dot tab list.

Before we go any farther, I need to point out for anyone new to DotNetNuke, that tab = page.  The first versions of DotNetNuke referred to pages as tabs and thus all the database tables and software routines still contain the name “tab”.  So the database table containing all the information about a page is called “Tabs” and the object containing a page's information is TabInfo.  So, while reading this post, remember “Tab = Page”.

As you are probably aware, the menu is based on the pages and this indented dot tab list would be perfect to populate my starting page dropdownlist in the revised MenuLinks module.  The indented dot tab list is used in many core forms such as the Links module and Announcements, so it must exist somewhere – great! Code-reuse is good thing.

So I naturally started with the TabController as what I was after was a list of Tabs. No such luck.  Not sure why it’s not located there, but it isn’t. 

Since the indented dot tab list is present in so many locations, I found the UrlControl that is used on the various forms.  Should be easy to located the code in the associated code-behind vb file?  Not so fast.  The vb file is rather large and the User control is somewhat complex in that it can display several different list based on user selection.  However, after some digging I discovered the routine GetPortalTabs

At this point I should have loaded DotNetNuke into Visual Studio and let it do the work when searching for the location of the routine.   But I was sure I would fine it quickly using the Notepad2 editor.  After several false starts and wrong turns, I discovered the routine in \dotnetnuke\library\components\shared\globals.vb.  This routine hold many interesting routines, but that’s another story.

All that is left is to determine how to use the routine.  The routine requires the desired portalid along with several Boolean parameters that determine what tabs to included/exclude from the returned arraylist of tabinfo objects.  But where are the indented dots?  Well it seems that the routine updates the tabname property with the appropriate number of dots based on the tab level.  

So back to MenuLinks and replace the TabController call to GetTabsbyPortal with a call to GetPortalTabs.  I also had to ensure I imported DotNetNuke.Common.Globals namespace.  I populated the dropdownlist by “foreaching”  the arraylist and using the tabname to populate the dropdownlist along with the tabid as the value.  I used the current tabid to set the selected item if the saved starting tabid was underfined.  Works like a charm.

So what did I learn from this effort?

1) I should spend the time to load up DotNetNuke source into Visual Studio and use the power of Visual Studio to help search for the appropriate library
2) I should not attempt to “guess” at where something is located – not for a while longer because my guessing is wasting time until I learn more of the DotNetNuke core.
3) Remember to save the blog post more often – this is second attempt at this post as the first was lost to a misplaced mouse click.  Told ya I was spending more time than normal .. hmmm

Hope this helps others when search the innards of DotNetNuke core. 

Happy Hunting
Paul.
 

Tags:

Your name:
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Security Code
Enter the code shown above in the box below
Add Comment   Cancel 

Blog_List Maximize
Print  

  Home | Blog | Forum | Subscriptions | Free Modules   Page generated in 0.0400576 seconds.
  Copyright 2010 by TressleWorks   Terms Of Use | Privacy Statement