FOTD 03: Fireworks 8 CSS Pop-Up Menus

| 18 Comments

One of the most popular features in previous versions of Fireworks had to be the pop-up menu generator. However, despite being handy and popular, these menus had a lot of inherent problems that became evident over time (not search engine friendly/indexable, difficult to customize after the fact, maintained links in JS files, etc.). The new CSS Popup Menus feature in Fireworks 8 is a much different story, however- much more robust than any prior 'stock' pop-up menu features in Fireworks or Dreamweaver (although I still recommend learning the basics of menu generation yourself as well- visual tools are great, but understanding the underlying principles is a skill worth cultivating). Here’s the basic rundown for creating pop-up menus in Fireworks 8.

So, we've got a plain-Jane navigation bar in Fireworks that needs some help- we want to add a drop-down menu to the 'Products' section to allow deeper navigation from the menu. Just select a slice or hotspot on your image (this demo made with hotspots for simplicity's sake), then choose “Modify > Pop-Up Menu > Insert Pop-Up Menu...�?. You’ll then be presented with the swanky new Pop-up Menu Editor interface, shown here:

content_tab_sm.jpg
Pop-up Menu Editor - Content Tab

Within the Pop-up Menu Editor interface, you'll find a preview pane at the top, and tabs for Content (manage your links, targets and text labels for the menu itself), Appearance (selection of the color and font themes, style and type of menu), ‘Advanced’ (width, height, padding, spacing, borders and their colors for the menu items themselves), and ‘Position’ (i.e. the x/y offset and placement of the menu in relation to the hotspot/slice that activates it). Let's step thru these options one by one.

First, we've added some entries to the pop-up menu (see above screenshot) by clicking the '+' icon at the top of the list box (or just double-click in the 'ghosted' first entry to start typing), and then entering the link, text label for the menu item, and (if necessary) a target for the link. I generally don't use target attributes, so will leave that column blank if you don't mind. ;-)
For submenus, enter and order your content, then use the two indent/outdent buttons (right underneath the Content tab, for the curious) to 'indent' a given line as a submenu item- it will eventually become a submenu underneath the next highest 'parent' entry. Next, let's click on the 'Appearance' tab, to give our pop-up menu a more custom look. Here's the options available within 'Appearance':

appearance_tab_sm.jpg
The Appearance tab

Within the Appearance tab, you'll find the following options:

  • Cells: HTML or Image
    Specify whether your pop-up menu will be straight HTML, or use images as their background.
  • Vertical/Horizontal drop-down menu
    Choose whether your pop-up menu will fly out vertically, or horizontally.
  • Font/Size/Style
    Choose the font(s) and font size used for your drop-down menu's text, and both their formatting and alignment.
  • Up State/Over State
    Select the background and text color for both the default and 'active' (i.e. the mouse is over it) menu choices.
  • Image Styles
    If you have chosen 'Image' as your cell type, you can choose a style for your button's background here (not shown in this screenshot).
  • Preview
    As you'd expect- you can preview your changes in realtime down in the bottom-most pane.

For purposes of this demo I've just chosen the HTML style of menu, of course. Let's take a look at what you can specify in the 'Advanced' tab next:

advanced_tab_sm.jpg
The Advanced Tab


The Advanced tab lets you specify the menu's cell width/height, padding and spacing (width/height can be either a pixel value, or automatically generated), along with a default indent for your menu items and a delay (in closing the menu after a user's mouse has rolled off the 'hotspot'). You can also choose whether to show borders on your menu, a width and color for that border, and whether a shadow/highlight should be added to each menu entry. Next up, the 'Position' tab:

position_tab_sm.jpg
The Position Tab


Within the 'Position' tab, you'll tell Fireworks where you want the pop-up menu displayed, in relation to the hotspot/slice it's attached to. You can choose to have the menu pop up to the left, right, top or bottom of your hotspot/slice, and customize it as needed in pixel values to get things 'just so'.
You can also specify (and/or override) the offset value for your submenus, within the 'Submenu Position' section. Options include offset and aligned with the bottom of the parent menu item, offset and parallel with the parent menu item, or aligned with the bottom/center of the parent menu item. The checkbox can be toggled to make the submenu appear at the exact location of the parent item as well, if that's your intent.

Click "Done", and you’ve just created your pop-up menu! All you need to do now is select the "File > Export..." menu option, and click the 'Advanced' button next to the 'Export' drop-down menu (which should be set to "HTML and Images"). In the first (General) tab of the Options dialog, make sure 'Use CSS for Popup Menus' is selected, and 'Write CSS to an external file' if that's your preference.

export_options_sm.jpg
The Export Options dialog


Continue your Export process as usual, and you're done!
(Make sure to check out Greg Rewis' blog for a Captivate simulation of this feature, as well. He should have it live shortly after this post goes out- if it isn't live already, FYI.)

One caveat- this feature is in Fireworks and not in Dreamweaver, so you won't be able to round-trip Fireworks popup menus in DW 8 (but as always, you can dive into code mode and hand-tweak if you so desire). And although I strongly recommend learning how to build CSS pop-up menus by hand (and using lists to do so- which really helps both for keeping your (x)html clean and flexible), if you need quick and simple pop-up menus, this feature will definitely be of interest. Of course, there are a wide range of amazing third-party extensions and options for pop-up menus that can offer far more options (pop-up menus have proven VERY popular in the extension development community) - but it's nice to know there's a reasonable, default option available within Studio 8 right out of the box that doesn't rely solely on Javascript to get the job done. Enjoy!

18 Comments

G'day Scott, thanks for this insight. Can you tell us if this code will validate?

Hey, IsK!
Just ran a validator on an unmodified test page straight out of Fireworks, and it's validating just fine as XHTML/Transitional (my default doctype)- so it looks like the answer's a yes! HTH.

I am using Studio 8 and recently upgraded from MX 2004. I am adding individual buttons to make a horizontal navigation tool across the top page of a template. My pop up menus were working fine with MX 2004 but now I am finding (with Fireworks 8) that the first button that I insert into my Dreamweaver page works as designed, but when I add other buttons the drop down menu appears almost off the page i.e. when I view the page in a browser the menu does not appear below the button as I had wanted. It is disjointed.

Any advice?

I have been trying to export a file that has been sliced up with menu items in it. It was origionaly done in mx and now I am using version 8. Everytime that I export it ends up with java instead of css. All of the settings are set to export css but it just does not work. HElp??????

Hey, Ross-
It's really hard to say without diving into the source code (and unfortunately I don't have the spare bandwidth for troubleshooting right now), perhaps you could post a link to the code on the Fireworks forum and get some community eyes on it?

http://www.macromedia.com/support/forums/fireworks/

I'm sure you'll get advice on a whole slew of other menu/nav bar options, of course- but that's probably the best spot for more involved troubleshooting. ;-)

Dave- if you've specified CSS in the menu settings, then you should be getting exactly that. I'd open up a support ticket, as this doesn't sound correct to me:
http://www.macromedia.com/support/contact/

HTH!

how can you shorten the length of the individual dropdown text as it uses the longest length of the longest character. it seems it uses one lenght based on the longest text. how can u individually resize it?

Just set the width to whatever you'd like, and the height to automatic, in the 'Advanced' tab (see screenshot above, FYI). This should set a fixed width to the menu and let the cell 'grow' in height if the text for a menu item needs to wrap. Otherwise, yes- it'll try to fit all the text horizontally and use the 'automatic' width default.

Is it possible with Fireworks 8 to export web page in XHTML (only DIV tags and CSS styles) ?

Yes- in FW 8 you can export as CSS Layers, which exports unfortunately moves the CSS code to an inline style for each absolutely-positioned DIV. Given that, I'd also move that inline CSS to an external stylesheet later for more flexibility. HTH!

can i make a dynamic one.

http://haqconsultants.com
http://mannan.zabvision.edu.pk

Sure, I'd simply build out the pop-up menu with 'dummy' data (i.e. placeholder data) in FW, exporting it and integrating it into your design, and then replacing the menu entries with the appropriate dynamic calls based on your server/environment/programming language/etc.

However, no- Fireworks won't let you build a dynamic pop-up menu in one fell swoop- but this is how I'd proceed in implementing it. Hope that helps out!

can you plz help me? can i email you?

Hi, Abdul-
If you've got product-specific questions, I'd post them in the Fireworks online forums- which is the best place to get a broad range of responses from both MM (Adobe) staffers and the product community. I don't have the bandwidth to do 1:1 support on issues, though- sorry.

Hope this helps out!

Okies,

thanx man, i have done it, thanx again.

Hi,
Can any one help me, i've finished my homepage for a website that i'm creating and have a css drop down created and exported.

What i want to do is transfer the menu over to my homepage in dreamweaver from the exported documents. What do i do, i've tried every thing.

I'm using Studio 8 by the way.

Thanks
Lennie

I like this Fireworks tool, except that if you want a border on your menu in HTML format, you are _forced_ to have a highlight and a shadow for that border. There's no "none" choice. In other words, It's not possible to have a simple 1px border around your menu items; you have to settle for a 3D effect, or for a fat 2px outer border. The fact that I can probably fix it by mucking around with the CSS for a couple hours is small compensation; it's reminiscent of the absurd amount of work it took to get a plain 1px border on a table in the pre-CSS days. What is it about programmers that makes them insist on fake 3D as the *default* appearance for a bordered box?

Lennie- you should be able to drop the HTML generated from this tool into your Dreamweaver pages, but you may need to address the URLs to make sure that they're pointing to the right location after doing so. Check your CSS/image URLs in the final DW page if you're not getting it to load. As noted in a comment above, I also recommend posting specifics on problems like this to the Fireworks forums to let other community folks jump in and lend a hand (sorry, my bandwidth is tight these days so it's difficult to offer 1:1 assistance myself):

http://www.macromedia.com/support/forums/fireworks/

Joel- great point, I hadn't noticed that restriction as of yet. I'll be sure to pass your comment along to the product team for consideration in future revisions of FW. Thx!

Its pretty helping tutoial,
it helped me much

thanks
http://www.dizyn.com

Leave a comment

About this Entry

This page contains a single entry by Scott Fegette published on August 10, 2005 11:15 AM.

FOTD 02 - Flash 8: Video Import Wizard was the previous entry in this blog.

FOTD 04: Dreamweaver 8 - Background File Transfer is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.