2. 2 Company Confidential
What we’ll be covering
Evolution of DDRMenu
Upgrading existing skins
Included and freely available menus
Building your own menus
Configuration
“Power user” features
4. 4 Company Confidential
Evolution of DDRMenu – v1.0
Development started late 2008, straight DNNMenu
replacement
Extended to emulate SolPart
XSL templates introduced
v1.0 released as freeware June 2009
5. 5 Company Confidential
Evolution of DDRMenu – v2.0
v2.0 with token and Razor templating released as open
source start of March 2011
Donated to DotNetNuke by end of March!
Used in DNN 6 for UL mega menus in default skin, admin
menu and actions menu
7. 7 Company Confidential
What’s wrong with DNNMenu?
V1 uses onclick instead of true hyperlinks
• Poor SEO
• Poor accessibility
• No URL on mouseover
• No right-click support
Browser sniffing not feature detection
Only one style
Limited support
8. 8 Company Confidential
How does DDRMenu help?
Renders as unordered list in HTML source
jQuery for cross-browser compatibility
Converts UL to DNNMenu layout at client
Overlays hyperlinks
Adds animations
Same approach for SolPart
Templates for user-defined menu types
9. 9 Company Confidential
Upgrading DNNMenu
1. Install DDRMenu (if pre-DNN 6)
2. Replace
<dnn:NAV ProviderName="DNNMenuNavigationProvider">
with
<dnn:NAV ProviderName="DDRMenuNavigationProvider">
3. That’s it …
16. 16 Company Confidential
Building your own templates
XSLT
• Very flexible
• Supported in all versions of DNN & .NET
• Can be a bit scary if not used to functional programming
Razor
• Completely flexible - access to DotNetNuke API
• Only in DNN 5.6 or 6 with .NET 4
• C# or VB
Tokens
• Relatively easy
• A bit restrictive
19. 19 Company Confidential
Choosing pages to show
NodeSelector
• “rootonly” – top level only
• “rootchildren” – children of current root page
• “currentchildren” – children of current page
• {root},{skip},{depth} – more complex scenarios
IncludeNodes
ExcludeNodes
IncludeHidden
22. 22 Company Confidential
Power features
Add as module
Use as action menu
Automatic internationalisation
Custom node manipulation
Localisation of custom strings
Supply custom XML
23. 23 Company Confidential
Summary
Upgrade DNNMenu and Solpart for a quick win in existing
skins
Use new templates for simple new skins
Create your own templates for more complex menus (e.g.
conversions)
Contribute the results!
Show standard DNNMenu
Show no mouseover text, no right click
View source, show no hyperlinks
Update to DDRMenu
Show mouseover text and right click
Show unordered list in source
<%@ Register TagPrefix="dnn" Namespace="DotNetNuke.UI.Skins" Assembly="DotNetNuke" %>
<CustomAttributes>
<dnn:CustomAttribute Name="effect" Value="puff"/>
<dnn:CustomAttribute Name="effectOptions" Value="{percent:200}"/>
<dnn:CustomAttribute Name="effectSpeed" Value="slow"/>
</CustomAttributes>
Show puff effect
Show no effect
All available with the standard DNN distribution for you to use or tweak.
Superfish is a standard unordered list flyout menu, like DNNMenu in undordered list mode.
TreeView and Accordion are standard jQuery plugins.
HTML <select> is just a dropdown listbox.
jQuery UI is introducing a menu control in version 1.9. I’ve got a prototype template working with the current pre-release version, and once it’s actually released I’ll add it to the gallery.
I’m hoping for lots of contributions, Armand of 2DNN has already got one mostly ready and I’ve had a couple more promised.
Install all templates into skin folder
Add <%@ Register TagPrefix="ddr" TagName="MENU" Src="~/DesktopModules/DDRMenu/Menu.ascx" %> to start of ASCX
Add <ddr:MENU runat="server" MenuStyle="Superfish" />
Show and repeat for jQueryToolsAccordion, Treeview, Dropdown, 2DNN Mega, ULXSLT, leading on to …
XSL is a complete functional programming language, designed for exactly this sort of work.
Razor can do anything, it has full access to the DNN API and so if you can guarantee that you’re on a recent build of DNN and .NET is an extremely powerful option.
Tokens on the other hand are very simple. Just token replacement and a bit of conditional and looping logic. Great if you’re going to use JavaScript for all your logic.
First show DumpXML, explain that this is the underlying data.
Then switch back to ULXSLT, show template source
Then show ULRazor
Finally show ULTokens
Show plain menudef.xml from ULXSLT
Open up menudef.xml from 2DNN Mega and Superfish to show CSS/jQuery options for redistributable templates
A common use of NodeSelector is to simply supply the root page by name or ID.
IncludeNodes and ExcludeNodes work by tab id or name on the top level pages. Usually used for Admin and Host in versions 4 and 5 of DNN, but can also be used to partition the site in other ways.
IncludeHidden is a new feature in DNN 6. It allows you to access any hidden pages. Again, this allows you to hide a set of pages from general view but have them available for specific menus. It’s used for the Admin and Host menus in the DNN control panel, and could be used e.g. to separate out a mobile section of a site.
Demonstrate NodeSelectors:
rootonly
rootchildren
currentchildren
(root, skip, depth) – e.g. Page name for root
Demonstrate IncludeHidden (show a set of pages hidden from the main menu):
<ddr:MENU MenuStyle="Mega" IncludeHidden="true" NodeSelector="Hidden" runat="server" />
Module is exactly as you’d expect, all the same settings and so on apply.
You can also use it for action menus, either to improve the positioning of a DNNMenu style action menu in DNN 4 and 5, or in DNN 6 it’s been used to provide a mega-menu style.
Internationalisation automatically picks up Ealo, Apollo, Adequation and of course native DNN localisation, plus any module which implements the right interface.
Custom node manipulation allows you to supply your own code to add, change or remove pages in the menu before displaying them. For instance, you could add a custom menu that links directly to particular views of a single module.
You can localise your own strings, for example if you’ve got a mega menu that needs custom headings or descriptions.
Finally, you can supply your own XML file if you want to use a DDRMenu template to display a predefined set of options.