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, ...Submenu different styling per menu itemSubmenu different styling per menu item
Previous
 
Next
New Post
2/4/2011 2:41 AM
 
Hello everybody!

I got a issue I would love to share with you, hopefully someone knows a solution for this.

- I have a horizontal menu.
-- In this menu there are 2 root items with a submenu (for now).
--- Every root item has a different background color. (for example: root menu item 1 has a green background, root menu item 2 has an orange background,...)
---- Every submenu has to have a hover with the same background color as the 'expanded' root item (for example: the submenu of the 1st root item has to have a green hover background over every item, submenu of the 2nd root item has to have a orange hover background over every item always including sub-submenu items) ).

I COULD set every CSS ID of every sub-menu-item (wich are allready in it) with a hover with the correct background color, BUT when I ass new sub menu items, they won't have the hover with the correct background color.

I've stumbled onto a website with some Nav Menu Features for CSS: http://www.dnngo.net/DNNFreeResources...

But I can't get it to work...

Here is the code and CSS, for anyone who wants to try to recreate my Menu to look for the solution of this..

ASCX (just the basic declartion to load NAV Menu):
<div id="menuMenu">
<dnn:NAV runat="server" id="dnnNAV"  ProviderName="DNNMenuNavigationProvider" IndicateChildren="false" ControlOrientation="Horizontal" CSSControl="mainMenu" />
</div>

There are 4 root items defined (doesn't matter wich ones exactly)

CSS:

 

/*-- DotNetNuke menu styles --*/
  
/* Main Menu td */
.mainMenu {
 cursor:pointer;
 font-size: 11px;
 width:100%;
color:#FFF;
}
/* Main Menu Normal */
.mainMenu .root 
{
padding-left:5px;
padding-bottom:2px;
 color: #FFF;
 font-size: 13px;
 text-align:left;
width:146px;
 margin-bottom:5px;
 display:inline-block;
}
/* Main menu colors */
#dnn_dnnNAV_ctldnnNAVctr41 /* 'Root item 1' */
{
background-color:#FF6633;
}
#dnn_dnnNAV_ctldnnNAVctr62 /* 'Root item 2' */
{
margin-left:5px;
}
#dnn_dnnNAV_ctldnnNAVctr62 /* 'Root item 2' */
{
background-color:#99CC33;
}
#dnn_dnnNAV_ctldnnNAVctr63 /* 'Root item 3' */
{
Background-color:#00CCFF;  
margin-left:5px;
}
#dnn_dnnNAV_ctldnnNAVctr64 /* 'Root item 4' */
{
Background-color:#8D7E74;
margin-left:5px;
}
/* Main Menu hover */
.mainMenu .hov {
 color:#fff;
 background-color:Red;
}
/* Main Menu selected */
.mainMenu .sel, .mainMenu .bc {
 color:#FFF;
}
.mainMenu table {
 margin-top:5px;
 z-index: 5000;
}
/* SUB Menu Normal */
.mainMenu tr.mi 
{
 background-color:transparent;
 z-index: 1000;
 font-size: 11px;
 font-weight:bold;
 text-align:left;
 color:#FFF;
 line-height:2em;
 text-transform:none;
}
.mainMenu tr.mi td {
 padding: 0 2px;
 text-transform:none;
}

Any questions? Let me know!

Thanks alot for your help!



Alex
 
New Post
2/4/2011 4:33 AM
 
I've just found the solution myself, haha..

For anyone ever wanting to try this in the future or now, I'll put up here what i've did wrong..

As you can see I've always tried with the "#dnn_dnnNAV_ctldnnNAVctr41" and from there speak to the child 'tr' or whatever for the submenu's
BUT I had to define the "#dnn_dnnNAV_ctldnnNAVsub41 tr.hov" (the only difference between these is the 'ctr' and 'sub' definition in the class..

So for example:
If you want the first menu root item have a background of orange, you put:

( !! You will have to use the correct root menu ID defined by your DotNetNuke Nav Menu, in my case it's "#dnn_dnnNAV_ctldnnNAVctr41" !! )

#dnn_dnnNAV_ctldnnNAVctr41
{
    background-color:Orange;
}

If you want the submenu of this menu item to have a orange hover background (like me), you just put "#dnn_dnnNAV_ctldnnNAVsub41 tr.hov" with it..
example:

#dnn_dnnNAV_ctldnnNAVctr41, #dnn_dnnNAV_ctldnnNAVsub41 tr.hov  
{  
    background-color:Orange;  
}

and so on..

Hope it helped for someone, if someone had the same problem like me..

I have yet to figure out how to get the sub-sub menu's having a hover background color, even the ones you make new.. (Because I can put in the CSS the ID (in my case "#dnn_dnnNAV_ctldnnNAVsub66 tr.hov") BUT this is only for existing sub-sub menu, not new ones somewhere else in the submenu)
 
New Post
2/15/2013 4:11 AM
 
Hello!
Do you have any idea about who to find the root menu ID in dnn7, i'm trying to create the same but it look like that dnnNAV_ctldnnNAVctr is not used in dd7

Thanks,
 
New Post
2/18/2013 6:54 AM
 

If you are using the ddrmenu xslt tempalte option to create your menu I wrote an article about how to do this uch cleaner and reusable

http://www.dnnhero.com/Premium/Tutorial/tabid/259/ArticleID/12/Beginning-XSLT-with-DDRMenu-for-DotNetNuke-Part-2.aspx 

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Submenu different styling per menu itemSubmenu different styling per menu item


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