Oct
15
Written by:
Ralph Williams
Thursday, October 15, 2009 6:43 PM
"It needs to be dynamic." That is what my boss is always saying to me when it comes the newest bit of usability that I want to add to my latest DotNetNuke site. He keeps telling me that whatever I do, it needs to be automatic for our client using the website. So, the latest bit of usability that I wanted to add was, having a list of quick links in the footer of each page. Basically, I wanted to take the clients services and make them a list in the footer and hey, DNN should allow me to do this easily, right?
I posted this question to Twitter and received no response, other than someone else was looking for and answer as well. So, I had to do some digging on my own. Ugh. I am using the Telerik RadMenu and went through the Skinning Whitepaper. I finally came across the ShowOnlyCurrent attribute which didn't sound like what I wanted. This is great for sub menus and I use this all the time. But, this great tool also allows you to use specific page's child items. Perfect! So, here is how you do it:
Note: This uses the Telerik RadMenu.
- Open your skin's ascx file that you wish to change.
For Example: /portals/0/skins/mydesign/skin.ascx
- Place a new RadMenu control
<dnn:RADMENU runat="server" id="dnnRADMENU" /> in your skin where you wish to have your links. Note: I am using RadMenu Version 4.4.4 this could be different depending on your version.
- Change the id to something unique. I usually use:
dnnRADMENU1
- Hide the admin menu by adding the attribute:
EnableAdminMenus="False"
- Specify a new Class name (I am using footer-menu) for the new menu using the attribute:
CssClass="footer-menu"
Note: To make your life easier, be sure to name your main menu in the same way,
for example: CssClass="main-menu"
- Then specify the parent page of the child links you wanted displayed using the attribute:
ShowOnlyCurrent="[TABID]"
- Replace
[TABID] with the ID of the parent page. In my case, the TABID is 2021. So, it would be ShowOnlyCurrent="2021"
- You can also use the Page Name by using PageItem. So if it were the Services page, it would be
ShowOnlyCurrent="PageItem:Services"
- The final result will look something like this:
Again, this could vary, depending on your version of RadMenu.
<dnn:RADMENU runat="server" id="dnnRADMENU2" CssClass="footer-menu" ShowOnlyCurrent="2021" EnableAdminMenus="False" SkinsPath="*SkinPath*/Menu/" Skin="Dnn" ShowPath="true" />
Screenshot of main menu with child drop downs.
Screenshot of home page footer with child items from the Products page.
4 comment(s) so far...
Re: Dynamic Quick Links with DotNetNuke and Telerik RadMenu
Thanks for the tip Ralph!
By Greg Brown on
Friday, October 16, 2009 11:51 AM
|
Re: Dynamic Quick Links with DotNetNuke and Telerik RadMenu
Thanks for the Tip on this...I've looked into this once before.
The upside here is that you could use multiple instances of the RadMenu in your footer to "categorize" all your sub links for each of your parent pages into individual columns, etc. which adds to design flexibility greatly.
The downside, at least as far as I can tell, is that if you want to only show the child links in the footer for the page you are on, with the standard top-level links being displayed above/below, etc. You'd have to create a separate skin file for EACH page you wanted to do this on, unless you could dynamically assign the value for "showonlycurrent" to that instance of the radmenu control through vb / c#.
Something like:
FooterChildLinks1.ShowOnlyCurrent=PortalSettings.ActiveTab.ParentID (for the current page's parent if you happen to be on a subpage)
OR
FooterChildLinks1.ShowOnlyCurrent=PortalSettings.ActiveTab.BreadCrumbs(0).TabID (for the Root Page of the current page, even if you're several children deep)
Then, you could have 1 skin with a "page links" section in the footer that would always show the child links for the Parent Page or Root Parent of the page you are on.
I know this can be done through a custom event handler (via javascript) and hooking into the RadMenu's Load event, as I'm doing something similar now, but it seems like you should be able to do it through code (either by adding a code-behind page, or in-page script).
Just my 2 cents worth. Great post, though. Would have been nice to come across this a few weeks ago. Would have saved me the same headache.
By David on
Friday, October 16, 2009 12:27 PM
|
Re: Dynamic Quick Links with DotNetNuke and Telerik RadMenu
nice idea Ralph, though could I suggest that rather than hard-coding the id, you should be able to set it either in codebehind, or else should work in the skin definition.
By cathal on
Friday, October 16, 2009 12:29 PM
|
Re: Dynamic Quick Links with DotNetNuke and Telerik RadMenu
hmmm, filtering got my expression -
By cathal on
Friday, October 16, 2009 12:30 PM
|