Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Rendering DNN Nav Menu as an Unordered ListRendering DNN Nav Menu as an Unordered List
Previous
 
Next
New Post
3/12/2010 4:06 PM
 

I am using the following to render the DNN Nav Menu as an unordered list in DNN 5.02.03.

<dnn:nav id="dnnNAV" csscontrol="mainMenu" providername="DNNMenuNavigationProvider" runat="server">
  <customattributes>
    <dnn:customattribute value="UnorderedList" name="RenderMode" />
  </customattributes>
</dnn:nav>

This method seems to work well.  If I view the source code, it display the menu as expected in the following manner.

<ul>
    <li><a href="#">Main Link 1</a></li>
    <li><a href="#">Main Link 2</a>
        <ul>
            <li><a href="#">Sub Link 1</a></li>
            <li><a href="#">Sub Link 2</a></li>
        </ul>
    </li>
    <li><a href="#">Main Link 3</a></li>
    <li><a href="#">Main Link 4</a></li>
</ul>

I created styles according to this structure and it works if I copy the source code into a blank html file.  However, 
when I apply the same css to the dnn site, the styles are not reaching the sub menu items (the nested ul). When I 
inspect the menu with Firebug in Firefox, I notice that my nested UL tag is no nested but is located beneath the 
main menu code in the following manner
<ul>
    <li><a href="#">Main Link 1</a></li>
    <li><a href="#">Main Link 2</a></li>
    <li><a href="#">Main Link 3</a></li>
    <li><a href="#">Main Link 4</a></li>
    <ul>
        <li><a href="#">Sub Link 1</a></li>
        <li><a href="#">Sub Link 2</a></li>
    </ul>
</ul>
Has anyone come across this? Is there a way to resolve this issue?

 
New Post
3/15/2010 10:27 AM
 
What's your CSS like? What classes are used for this? Jeff
 
New Post
3/15/2010 11:35 AM
 

Hi Jeff,

I only use one class at the root of the menu. 

So <ul class="navigation" id="dnn_dnnNAV_ctldnnNAV"> is what get's rendered.

All other styles are applied through nested references... such as

/*Styles the primary nav.*/
ul.navigation li a:link { /*--- styles ---*/ }

/*Styles the drop down menus.*/
ul.navigation li:hover ul li a:link { /*--- styles ---*/ }

Again, the styles work perfectly when I pull the html generated from the DNN Nav menu into a "test" html file, but when I inspect the menu within DNN using Firebug, the html is improperly nested...  It's appears that the html code is getting generated correctly, but repositioned with JavaScript causing my css selectors not to find their intended targets... but that is just a guess.

Let me know if you would like me to post my entire css sheet.

Thanks.

 

 
New Post
3/15/2010 11:54 AM
 

*UPDATE*

I have confirmed that JavaScript is in fact changing the position of HTML code when the DNN Nav menu is rendered as an unordered list.

If I choose not to display styles in Firefox, the menu displays as follows

  • Home
  • About Us
  • Our Store
  • Contact Us
    • Who We Are
    • What We Do
    • Why We Do It

This is not correct as the sub-menu items of Who We Are, What We Do, and Why We Do It should all be under/nested within the About Us primary-menu item

If I disable JavaScript using the Web Developer Tool Bar in Firefox, the menu displays as follows

  • Home
  • About Us
    • Who We Are
    • What We Do
    • Why We Do It
  • Our Store
  • Contact Us

This IS correct and is typically the structure that is styled for when using CSS to style drop down menus.

This issue leads to the question of why does the DNN menu give the option to render it as an unordered list, but change the structure of the html with JavaScript? Is this a bug or is "spiderability/SEO efforts" the ONLY reason the DNN menu supports rendering as an unordered list? Can the JavaScript be disabled through another custom attribute?

 
New Post
3/15/2010 1:41 PM
 

You are right it is rendered that way. You can however styke the menu how you like to using the css the module render.

/*
.m          All Sub Menu                .m      All Sub Menus
.m[level]   Sub Menu at level x         .m0     First level sub menus
 
.mid[id]    Sub Menu with id x          .mid39  DNN Admin Sub Menu
.break      Break                       .break  All menu breaks
.mi         Menu Item (all)             .mi     All Menu Items
.id         Menu Item with id x         .id41   Menu Item with id 41
.mi[path]   Menu Item in specific path  .mi0    First Menu Item (Home)
                                        .mi1-0  First child of second root menu (Admin-Site Settings)   
 
.root       Root Menu Item              .root   All root menu items
.first      First Menu Item             .first  First menu item in each menu
.last       Last Menu Item              .last   Last menu item in each menu
                                        .first.last First & Last menu item in each menu
 
.icn        Icon
.hov        Hover
.sel        Selected
.bc         BreadCrumb
.txt        Menu Text */
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Rendering DNN Nav Menu as an Unordered ListRendering DNN Nav Menu as an Unordered List


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out