close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Link CSS menu code to other pages

Thread began 11/02/2009 9:56 am by dconnerusa | Last modified 11/03/2009 3:28 am by jon_upton | 2203 views | 5 replies |

dconnerusa

Link CSS menu code to other pages

I have created my first CSS Menu and want to link it to other pages so I don't have to change each page in the future. I don't see any information about doing this in your tutorials. You say link it to other pages via a Dreamweaver template, but my site is already created so I can't go back and create all the pages from a template.

Sign in to reply to this post

Jimmy Wu

One way you can add your menus to all your pages is to save the menu you created as a preset and then apply that preset to the pages in the location you want.

If you are using PHP, another way is to copy the require once for the menu that looks like this:
<?php require_once("CSSMenuWriter/cssmw/menu.php"); ?>

and put this in the body where you want the menu to show up.

Also copy the code that includes the css and scripts that should look like this:
<script type="text/javascript" src="CSSMenuWriter/cssmw/menu.js"></script>
<style type="text/css" media="all">
<!--
@import url("CSSMenuWriter/cssmw/menu.css");
-->
</style>
<!--[if lte IE 6]>
<style type="text/css" media="all">
@import url("CSSMenuWriter/cssmw/menu_ie.css");
</style>

<![endif]-->

Make sure to change the paths if the other file is not in the same directory as the first one.

If you are using non-php pages, you will have to copy the entire menu structure to the second page in addition to the css files and scripts. The menu structure should be similar to this:
<ul class="level-0" id="cssmw0">
<li class="parent"><a href="#">Item 1</a>
<ul class="level-1">
<li><a href="#">Sub Item 1</a></li>
<li><a href="#">Sub Item 2</a></li>
<li><a href="#">Sub Item 3</a></li>
</ul>
</li>
<li><a href="#">Item 2</a></li>
<li><a href="#">Item 3</a></li>
</ul>
<script type="text/javascript">if(window.attachEvent) { window.attachEvent("onload", function() { cssmw0.intializeMenu('cssmw0',{select_current: 0, orientation: 1}); }); } else if(window.addEventListener) { window.addEventListener("load", function() { cssmw0.intializeMenu('cssmw0',{select_current: 0, orientation: 1}); }, true); }</script>

Sign in to reply to this post

jon_upton

Templates is the answer

This is not a webassist issue this is a dreamweaver issue

You need to readup on creating templates in dreamweaver.

You make the menu part of the dreamweaver template in non editable region and when you make your pages from a template the menu is thereby included.

See WScbb6b82af5544594822510a94ae8d65-7acda.html for more information

Sign in to reply to this post

dconnerusa

You gotta be kidding!

There are other products out there from Plugin Lab and others that let you update all the menus on your site with a click. I'm surprised Webassist publishing a product that is this far behind the others!

Sign in to reply to this post

anonymous

Whoa... wait a second. I can promise that CSS Menu Writer is not far behind others. There is an easy way to fix your problem with a little logical thought here.

First, is the design of all your pages somewhat similar? I am assuming they are as you want to add the same menu to all of them.

Is what you want to do is find the code before and after where your menu will go on a page that currently does not have the menu. Let's for arbitrary purposes of example say it looks like this:

html:
<div id="headerArea">
Some stuff here.
</div>

<div id="innerContentWrapper">
Some more stuff here.
</div>



Now, let's pretend you want that shiny new menu of yours to be the first thing inside your "innerContentWrapper" on all the pages. It's simple, one quick Find and Replace with Dreamweaver will do the trick.

You could find every instance of

html:
<div id="innerContentWrapper">



And replace with

html:
<div id="innerContentWrapper">
<div id="myMenuHolder"><?php include the menu ?></div>



Regards,

Brian

Sign in to reply to this post

jon_upton

Originally Said By: dconnerusa
  There are other products out there from Plugin Lab and others that let you update all the menus on your site with a click. I'm surprised Webassist publishing a product that is this far behind the others!  



I think there are two issues that can be determined from your original post a) getting the menu on to multiple pages and b) effecting changes to the menu.

You get the best out of dreamweaver by using templated pages so you add the menu to the template and then create the page from a template. When you make a change to the template it is automatically rolled out to every page that is created from that template. In otherwords change it once and change all the pages. No copy and paste to all your pages or any other such malarky. This isn't about the capabilities of CSS Menu Writer its about using the best workflow method provided by dreamweaver.

When the menu is on every page if you change it using the extensions controls then all copies of the menu are automatically updated.

regards

Jon

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...