1
|
|
2
|
NICE MENUS MODULE
|
3
|
-----------------
|
4
|
|
5
|
Currently maintained by: Addison Berry (add1sun)
|
6
|
|
7
|
Orginally created by: Jake Gordon (jakeg)
|
8
|
http://drupal.org/user/15674/contact and http://www.jakeg.co.uk/
|
9
|
|
10
|
This module makes it easy to add dropdown and flyout menus,
|
11
|
using the Superfish jQuery plugin
|
12
|
(http://users.tpg.com.au/j_birch/plugins/superfish),
|
13
|
and falling back to CSS-only functionality when JS is disabled.
|
14
|
|
15
|
Please report any bugs, feature requests, etc. at:
|
16
|
http://drupal.org/project/issues/nice_menus.
|
17
|
|
18
|
|
19
|
Installation
|
20
|
------------
|
21
|
1. Copy nice_modules folder to your sites/all/modules directory.
|
22
|
2. At Administer -> Site building -> Modules (admin/build/modules)
|
23
|
enable the module.
|
24
|
|
25
|
3. Configure the module settings at
|
26
|
Administer -> Site configuration -> Nice Menus (admin/settings/nice_menus).
|
27
|
|
28
|
4. Configure the Nice Menus block(s) at
|
29
|
Administer -> Site building -> Blocks (admin/build/block),
|
30
|
setting the source menu and menu style, etc.
|
31
|
|
32
|
5. Return to the blocks page and enable the Nice menus block(s),
|
33
|
e.g. 'Nice Menu 1 (Nice Menu)' by putting it in a region.
|
34
|
|
35
|
6. See below sections on Customization and Advanced Theming as
|
36
|
well as the handbook page (http://drupal.org/node/185543) for more tips.
|
37
|
|
38
|
Upgrading
|
39
|
---------
|
40
|
For upgrades between versions, read the UPGRADE.txt file included with
|
41
|
the module.
|
42
|
|
43
|
Issues
|
44
|
------
|
45
|
You can track known issues at http://drupal.org/project/issues/nice_menus.
|
46
|
|
47
|
Customization
|
48
|
-------------
|
49
|
The module includes a default CSS layout file (nice_menus_default.css)
|
50
|
which is loaded for all pages. If you don't like the default layout,
|
51
|
it is suggested that you create a separate customized CSS file,
|
52
|
and replace the default CSS file at
|
53
|
Administer -> Themes -> Configure -> Global settings -> "Path to
|
54
|
custom nice menus CSS file".
|
55
|
This ensures smooth future upgrades as no editing of the module files is
|
56
|
necessary.
|
57
|
NOTE: you should not edit the regular nice_menus.
|
58
|
css file since this contains the "logic" that makes Nice menus work.
|
59
|
|
60
|
To help understand the CSS, the HTML looks like this, where
|
61
|
x is a number;
|
62
|
TYPE is down/left/right;
|
63
|
PATH is the menu path such as node/343;
|
64
|
MID is the menu id such as 33:
|
65
|
<ul id='nice-menu-x' class='nice-menu nice-menu-TYPE'>
|
66
|
<li id='menu-MID' class='menu-path-PATH'>
|
67
|
<a href='#'>This is a menu item</a>
|
68
|
</li>
|
69
|
<li class='menuparent menu-path-PATH'><a href='#'>A submenu</a>
|
70
|
<ul...><li...>...</li>
|
71
|
</ul>
|
72
|
</li>
|
73
|
...
|
74
|
</ul>
|
75
|
|
76
|
If you have more than one nice-menu and want to target a particular one,
|
77
|
use its id (e.g. ul#nice-menu-2).
|
78
|
|
79
|
A good starting point for your custom file is to make a copy of the
|
80
|
default file, then edit it to taste. Here are some common
|
81
|
customization examples for your own stylesheet:
|
82
|
|
83
|
Make hovered links white with a black background:
|
84
|
|
85
|
ul.nice-menu li a:hover {
|
86
|
color: white;
|
87
|
background: black;
|
88
|
}
|
89
|
|
90
|
Make the link to the current page that you're on black with yellow text:
|
91
|
|
92
|
ul.nice-menu li a.active {
|
93
|
color: yellow;
|
94
|
background: black;
|
95
|
}
|
96
|
|
97
|
Get rid of all borders:
|
98
|
|
99
|
ul.nice-menu,
|
100
|
ul.nice-menu ul,
|
101
|
ul.nice-menu li {
|
102
|
border: 0;
|
103
|
}
|
104
|
|
105
|
Get rid of the borders and background colour for all top-level menu items:
|
106
|
|
107
|
ul.nice-menu,
|
108
|
ul.nice-menu ul,
|
109
|
ul.nice-menu li {
|
110
|
border: 0;
|
111
|
background: none;
|
112
|
}
|
113
|
|
114
|
ul.nice-menu-right li.menuparent,
|
115
|
ul.nice-menu-right li li.menuparent {
|
116
|
background: url('arrow-right.png') right center no-repeat;
|
117
|
}
|
118
|
|
119
|
li.menuparent li, li.menuparent ul {
|
120
|
background: #eee;
|
121
|
}
|
122
|
|
123
|
Have a nice menu stick right at the top of the page e.g. for an admin menu:
|
124
|
|
125
|
#block-nice_menus-1 {
|
126
|
position: absolute;
|
127
|
top: 0;
|
128
|
left: 0;
|
129
|
}
|
130
|
|
131
|
In Firefox, as above but where the menu doesn't move as you scroll
|
132
|
down the page:
|
133
|
#block-nice_menus-1 {
|
134
|
position: fixed;
|
135
|
top: 0;
|
136
|
left: 0;
|
137
|
}
|
138
|
|
139
|
That should get you started. Really this is just about knowing your
|
140
|
CSS and styling it the way you want it.
|
141
|
|
142
|
Advanced theming
|
143
|
----------------
|
144
|
If you're creating or modifying your own theme,
|
145
|
you can integrate Nice menus more deeply by making use of these functions:
|
146
|
theme_nice_menus() -- themes any menu tree as a Nice menu.
|
147
|
theme_nice_menus_main_menu() -- themes your main menu as a Nice menu.
|
148
|
theme_nice_menus_secondary_menu() -- themes your secondary menu as a Nice menu.
|
149
|
|
150
|
If you really know what you're doing, you can probably even customize the menu
|
151
|
tree in creative ways, as those functions allow you to pass in a custom
|
152
|
menu tree.
|
153
|
|
154
|
nice_menus-7.x-2.4 support Upgrade included hoverIntent, jquery.bgiframe and
|
155
|
superfish plugin, requirement for jQuery 1.7+. download plugins to:
|
156
|
site/all/libraries/jquery.hoverIntent/jquery.hoverIntent.js
|
157
|
site/all/libraries/jquery.bgiframe/jquery.bgiframe.js
|
158
|
site/all/libraries/superfish/superfish.js
|