is not a kind of basket
Join Date: May 2004
|
Hello everyone,
As some of you might know, I have been working on a personal website for some time now. It looks good so far... a little lack of content but I'm filling it slowly. Anyhow... I have a question... The menu layout is the same in every page. . . There currently is eight pages in the site and another four in the works. . . If I adjust the menu, I have to copy and paste the Changes to each html file of my site... this is annoying because I am always adjusting the menu. Is there anyway for the HTML to call another HTML file for part of the page without using frames? The menu is left justified via tables and consists of an image map and image. So is there anyway of doing this so if I would like to make a change I only have to do it once and it effects the whole site? EDIT: Oh yah, I am doing this all by hand... no fancy/easy-to-use program, just little old me editing text files. Once again, don't even note frames, I hate them. (so ugly) no sig, how's that for being a rebel! |
quote |
Senior Member
Join Date: May 2004
|
I was going to tell you to use the library function in DW, but that obviously won't help if you're doing it by hand. It seems like there should be a way to do that, but I am not aware of one (besides frames, of course). Maybe there's a Javascript solution. I do not know.
OK, sorry, this post was pretty unhelpful. |
quote |
Less than Stellar Member
|
If your server supports them, server side includes look like they're for you.
Or you could use php to generate your pages. That would be my way of doing it. |
quote |
New Member
Join Date: May 2004
|
There is no way to do that with only html, you will need javaScript or better, php. If you simply want to change a piece of code in a batch of files the best way to do it is to use BBEdit - it has a batch search and replace function - very easy to use and bug-free, at least in my experience.
|
quote |
Less than Stellar Member
|
Quote:
|
|
quote |
New Member
Join Date: May 2004
|
Download BBEdit lite, open it, choose Search -> Find. A dialogue will come up that has all the entries you need to do batch search and replace. This is the easiest way to do what you want.
BTW, make sure you try this out on a copy of your html files, just in case it gets screwy. |
quote |
Fishhead Family Reunited
Join Date: May 2004
Location: Slightly Off Center
|
Quote:
|
|
quote |
is not a kind of basket
Join Date: May 2004
|
Quote:
And on a side note, I can't use BBEdit... I'm doing the work on a x86 Linux box. no sig, how's that for being a rebel! |
|
quote |
New Member
Join Date: May 2004
|
BTW again, php is a very cool language, worth learning but I think it would be overkill for this purpose.
|
quote |
New Member
Join Date: May 2004
|
If you are on Linux the best solution would be to look for an app or a module that does search and replace, or else use PERL.
|
quote |
Cynical Old Bastard
|
Doesn't this belong in a "Programming" forum (j/k)
You really have 3 options. 1. enable server side includes (.shtml) in apache and put your menu in a file and call the file from each page 2. install PHP (if you need help let us know) and make a php include file, then call that file on each page. 3. useing Perl to search and replace. This will work for now but will get very cumbersome as the site grows. IMHO, the PHP route is the best. It provides you more flexability in the long run plus you can add a database very easially. PHP is fairly easy to install, php.net has some great tutorials and I am also fairly familiar with installing both PHP and apache. If you want some examples on how to make a PHP include file or of PHP code just PM me. Last edited by kretara : 2004-05-21 at 08:59. Reason: spelling...whats that? |
quote |
is not a kind of basket
Join Date: May 2004
|
Quote:
And thanks for all the suggestions! I am going to take a look at PHP... but might endup doing the work the hard way. no sig, how's that for being a rebel! |
|
quote |
25 chars of wasted space.
|
Information on PHP.net about include()
It's amazingly easy. I'd suggest this PHP module (if your running it on your computer). PHP is an awesome langauage and while I have a lot to learn (check genius bar or ask silent echos ) it is relatively easy and very powerful. To have the same code show up on everypage simple add this to your html (php must be installed on the server): <?php include('dir/to/file'); ?> I'm pretty sure that is how you do it. Your web page probably has to end in .php instead of html or whatever, it won't effect anything though. You just put the repeating code in that file and then it will be placed wherever you have the include(). I'm sure someone will come tell me I'm wrong but I tried If you want to learn PHP without buying a book there isn't a place better then php.net |
quote |
Cynical Old Bastard
|
Quote:
<?php> include_once "left_nav.php"; <?> You can make a file called left_nav.php and place it in a directory somewhere (in the apache htdocs tree), I suggest in the "folder" where your .html/.php files will be server from. left_nav.php will contain any text/html/php that you want. include_once means what it says, only include this file once even if called more than once. BTW: you can also nest includes, ie. have an include file call another include file. Good Luck! Last edited by kretara : 2004-05-21 at 13:09. Reason: forgot to add link to include_once |
|
quote |
Which way is up?
Join Date: Aug 2004
Location: Boyzeee
|
If you place the css tag on the frame object, then the button manger should re-render the entire <.gif>. Try it out. If it doesn't work, though, you're probably doing it wrong.
Hope this helps. - K - AppleNova is the best Mac-users forum on the internet. We are smart, educated, capable, and helpful. We are also loaded with smart-alecks! :) - Blessed are the peacemakers, for they shall be called sons of God. (Mat 5:9) |
quote |
Posting Rules | Navigation |
|
Thread Tools | |