How to automatically change all menus?

  • sonnyrizo
  • Graduate
  • Graduate
  • sonnyrizo
  • Posts: 159

Post 3+ Months Ago

This question may sound a little confusing, but here it goes. I am working on a website, and sometimes need to update the main menu. There's only one problem: when I change the menu on the homepage, none of the other pages update the menu. How do I make Frontpage automatically update the menu on all pages at the same time?

That's what my problem has always been. One day, I decide to change the menu on the homepage, but then I have to go change the menu on all the pages.

I know there's something automatic in Dreamweaver that changes the menu for all pages, but what about MS Frontpage 2002?

Thanks.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • gsv2com
  • Professor
  • Professor
  • User avatar
  • Posts: 776
  • Loc: Nippon

Post 3+ Months Ago

You could use server-side includes or php to include a single menu file on all of the pages. Then all you'd have to do is update that one file. Not sure if Microsuck Frontpage supports shtml or php though.
  • sonnyrizo
  • Graduate
  • Graduate
  • sonnyrizo
  • Posts: 159

Post 3+ Months Ago

I think that's exactly what I am looking for. I was going to put in other words: have a table, in the template, link to an outside page, but I guess what you said is the same thing.

How do I do what you suggested (the server side thing or php)?
  • Scorpius
  • Proficient
  • Proficient
  • User avatar
  • Posts: 401
  • Loc: Scorpion Hole

Post 3+ Months Ago

In that table that you have your current menu in, take the actual menu and put it in a file called like menu.php or whatever you'd like. Then put this where you had the menu before:
PHP Code: [ Select ]
<?php
 
include "menu.php";
 
?>
  1. <?php
  2.  
  3. include "menu.php";
  4.  
  5. ?>

You will have to do this on all of your pages, but only once. And from my experience Frontpage will not show you the menu, just a blank area where it would be. You could probably also use Javascript for this, but I don't really know how to off the top of my head.
  • sonnyrizo
  • Graduate
  • Graduate
  • sonnyrizo
  • Posts: 159

Post 3+ Months Ago

Not trying to be a pain or anything, but is there any other way to do this? I'll try the PHP thing, but there may be an even easier way,
  • gsv2com
  • Professor
  • Professor
  • User avatar
  • Posts: 776
  • Loc: Nippon

Post 3+ Months Ago

Ok, how hard is this really?

<? include('page.htm') ?>
  • mackiller
  • Graduate
  • Graduate
  • User avatar
  • Posts: 108

Post 3+ Months Ago

you could use frames but that is way harder than SSI
  • gsv2com
  • Professor
  • Professor
  • User avatar
  • Posts: 776
  • Loc: Nippon

Post 3+ Months Ago

Not to mention bad, bad, bad.
  • neksus
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 2194
  • Loc: Canada

Post 3+ Months Ago

Frames definately aren't the way to go. Personally I'm recommending PHP, simply because I know how. I suppose you could use SSI, but it sounds like you're gonna wanna be into website development at one point. Thus learning PHP now would be an asset :D
  • gsv2com
  • Professor
  • Professor
  • User avatar
  • Posts: 776
  • Loc: Nippon

Post 3+ Months Ago

Whichever way you go at it will be easy, pretty much.

You could use shtml, frames, php, perl, asp, coldfusion, whatever the heck you choose to use. It's just not that hard whichever route you go.

In terms of using the least amount of keystrokes, php would be the way with shtml or perl probably right behind it.
  • sonnyrizo
  • Graduate
  • Graduate
  • sonnyrizo
  • Posts: 159

Post 3+ Months Ago

GSV2Com, I used what you recommended, but it didn't work. I tried the following HTML in one page, which links to menu.htm (a seperate page):

</table>
<table height="26">
<? include('menu.htm') ?>
</table>

I also used:

<?php
include "menu.php";
?>

But that didn't work either. What should I do? The problem is that the menu does not show up. I realize there could be many possibilites of what went wrong.

I opened notepad, typed up several words for the menu, and saved it as menu.php. The other time, I saved the document as menu.htm or html. I know an HTML document needs hearders such as "<HTML>" and "</HTML>" and I don't know if PHP needs anything similar to this. Maybe there's a "<PHP>" and "</PHP>" Anyhow, I didn't use "</PHP>" and "<PHP>"

What could I be doing wrong?
  • mackiller
  • Graduate
  • Graduate
  • User avatar
  • Posts: 108

Post 3+ Months Ago

php docs need the HTML tags too. If you want to desplay content. i use the .php estintions on my website even though they only use html you still need the <HTML> </HTML> and <BODY> </BODY> tags. Anything you would use in normal HTML coding
  • digitalMedia
  • a.k.a. dM
  • Genius
  • User avatar
  • Posts: 5149
  • Loc: SC-USA

Post 3+ Months Ago

I hate to offer a simple solution, but, if it's a static site, why not just use the find and replace function in FrontPage.
  • sonnyrizo
  • Graduate
  • Graduate
  • sonnyrizo
  • Posts: 159

Post 3+ Months Ago

Quote:

PostPosted: Mon Oct 04, 2004 3:05 pm Post subject:
I hate to offer a simple solution, but, if it's a static site, why not just use the find and replace function in FrontPage.


What's the "find and replace function"?
  • digitalMedia
  • a.k.a. dM
  • Genius
  • User avatar
  • Posts: 5149
  • Loc: SC-USA

Post 3+ Months Ago

In FrontPage, in the text menu at the top (File - Edit - View) got to Edit/Find...

The resulting dialog will have the means to "Find" and "Replace" a section of code/text.

You'll have a 'find' field where you'll paste the menu as it currently is, and then a replace field where you'll past the modified menu. Then there will be an option to preform this task for the current document, selected documents, open documents, project documents, etc.
  • Indulge
  • Beginner
  • Beginner
  • Indulge
  • Posts: 53
  • Loc: Germany

Post 3+ Months Ago

What about css? Would only work on graphic menu buttons, as I think, but you would just have to replace the graphic in the css-file and there you go...
Or is that a stupid suggestion...you pros out there?
  • ctompkins
  • Novice
  • Novice
  • ctompkins
  • Posts: 32

Post 3+ Months Ago

Try this, it is an Iframe (javascript) which is not as icky as html frames.

Code: [ Select ]
<html>
<head><title>myTitle</title></head>
<body>

<iframe name="FRAME1" src="myMenuPage.htm" width="800" height="50" frameborder="0" scrolling="no"></iframe>
<br>

The rest of my page goes here

</body>
</html>
  1. <html>
  2. <head><title>myTitle</title></head>
  3. <body>
  4. <iframe name="FRAME1" src="myMenuPage.htm" width="800" height="50" frameborder="0" scrolling="no"></iframe>
  5. <br>
  6. The rest of my page goes here
  7. </body>
  8. </html>
  • Mr Smith
  • Graduate
  • Graduate
  • Mr Smith
  • Posts: 150
  • Loc: Birmingham, England

Post 3+ Months Ago

sonnyrizo wrote:
</table>
<table height="26">
<? include('menu.htm') ?>
</table>



you've missed out the ending ; after the end )

change it to

<?php include('menu.htm'); ?>

it could also be that your file is in the wrong place.....could you tell us what error message you are getting?
  • criserb
  • Student
  • Student
  • User avatar
  • Posts: 70
  • Loc: Romania

Post 3+ Months Ago

hmm also you can use any editor you want and which knows to replace in multiple files. Like EditPlus - this is what I use, or Macromedia DW.

Take the menu that you want to change in all the page and put it in the 'find' field, after that, take the new menu and put it in the 'replace' field and click replace all.

But this is not a solution... the best solution is include method, (php or SSI) you can change the menu anytime you need without any headake

:)
  • 613flavah
  • battlestar
  • Web Master
  • User avatar
  • Posts: 3289
  • Loc: Hurricane...

Post 3+ Months Ago

Before you start using PHP make sure your hosting company SUPPORTS php. If it doesn't support that it should support the MS version which is ASP. The last thing you wanna do is create a site in either ASP/PHP and find out that your hosting company doesn't support it.
  • ctompkins
  • Novice
  • Novice
  • ctompkins
  • Posts: 32

Post 3+ Months Ago

What? Nobody likes my idea? :)

613flavah wrote:
Before you start using PHP make sure your hosting company SUPPORTS php. If it doesn't support that it should support the MS version which is ASP. The last thing you wanna do is create a site in either ASP/PHP and find out that your hosting company doesn't support it.
  • sonnyrizo
  • Graduate
  • Graduate
  • sonnyrizo
  • Posts: 159

Post 3+ Months Ago

Quote:
PostPosted: Tue Oct 05, 2004 10:41 am Post subject:
What? Nobody likes my idea?


Actually, your iframe tags are the only thing that worked for me. Everything that was suggested, in terms of PHP, didn't work. The iFrame thing did work, but I am afraid there will be problems in the future.

Quote:
you've missed out the ending ; after the end )

change it to

<?php include('menu.htm'); ?>


Did that. Didn't work either. I am not getting any error messages. It just doesn't show up.

Quote:
it could also be that your file is in the wrong place


That's not it. All files are in the same directory.
  • ctompkins
  • Novice
  • Novice
  • ctompkins
  • Posts: 32

Post 3+ Months Ago

What kinds of problems? The only valid argument I've heard against IFrames is that they are not supported in Netscape. But that's versions <= 4 so you're ok with everybody except those running windows 3.11 and below, sorry.


Quote:
Actually, your iframe tags are the only thing that worked for me. Everything that was suggested, in terms of PHP, didn't work. The iFrame thing did work, but I am afraid there will be problems in the future.
  • sonnyrizo
  • Graduate
  • Graduate
  • sonnyrizo
  • Posts: 159

Post 3+ Months Ago

Quote:
What kinds of problems?


I am afraid it will work like frames meaning that it will show up as frames, but work like it. What I hate about frames is that when you link to a website, you only link to the MAIN frame (or whichever frame you're in), not the whole page. That completely messes up things, because you have to hand out different URLs just for people to get to your website, or a link to the Index page.
  • ctompkins
  • Novice
  • Novice
  • ctompkins
  • Posts: 32

Post 3+ Months Ago

The IFrame is closer to an "include" statement. The nice thing is you don't need an html page just for frame declarations like html frames. It's a lot neater.

sonnyrizo wrote:
Quote:
What kinds of problems?


I am afraid it will work like frames meaning that it will show up as frames, but work like it. What I hate about frames is that when you link to a website, you only link to the MAIN frame (or whichever frame you're in), not the whole page. That completely messes up things, because you have to hand out different URLs just for people to get to your website, or a link to the Index page.
  • dirkplug
  • Novice
  • Novice
  • User avatar
  • Posts: 17
  • Loc: The Netherlands

Post 3+ Months Ago

Ok, using Frontpage this is easy to solve:

make one page with just the menu, menu.htm

then put this line in every page you want to display the menu.

<!--webbot bot="Include" U-Include="menu.htm" TAG="BODY" -->

Now you only have to maintain one html page for the menu, each time you change something in menu.htm the changes are also saved in the other pages.

REMINDER: if you change menu.htm, you still have do upload all pages with this specific line to your web site.

This line is only used by Frontpage...

Good Luck

Post Information

  • Total Posts in this topic: 26 posts
  • Users browsing this forum: No registered users and 65 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.