View Full Version : The Same Menu On Different Pages
blueskyboris 04-06-2005, 12:10 AM Got a question about time efficiency. I want to be able to change a menu, which appears on 17 different pages, from one location. In other words, when I change my menu, i do not want to have to change every menu individually. Is this possible? If so, how?
http://free.angeltowns.com/loveofwisdom/aristotle.html
Click on the authors on the bottom.
samdax 04-06-2005, 05:15 AM There is so many way to do this
javascript include (src)
Front page shared borders
Front page include
php include
...
SSI (server side include) is the best option
Make your meny in separate page (ex. menu.html)
in each page where you want to put your menu call include option
<!--#include file="path_to_menu.html" -->
Best option if you have all your pages in same folder, so you can use relative path.
Corey Bryant 04-06-2005, 08:36 AM Just make sure that your webhosting provider will support SSI, PHP, or ASP. And the pages will need to be renamed something like SHTML so the server knows to parse them
blueskyboris 04-06-2005, 12:32 PM How would I go about doing it with "javascript include"?
Corey Bryant 04-06-2005, 03:48 PM You would need to convert your menu to a JS. But doing this - some SEs will not follow the menu because JS is client-side
blueskyboris 04-06-2005, 03:49 PM Got a tutorial link n how to do this?
Corey Bryant 04-06-2005, 03:52 PM You might try the HTML to JavaScript converter (http://www.javascriptkit.com/script/script2/jstohtml.shtml) and see if that works.
Remember only translate what HTML you will be inserting. Not the entire page(s)
blueskyboris 04-06-2005, 04:01 PM I don't seem to be getting through.
My menu is changing. I want to be able to change it in one place for all similiar pages. Is this possible? If so, could you please show me how?
Corey Bryant 04-06-2005, 04:08 PM How is it changing - per page?
blueskyboris 04-06-2005, 04:10 PM Well, I intend to add new authors to it as I go along. Since this means a possible 50+ authors, with a menu on each page, I consider the time needed to upkeep such a system quite insane.
blueskyboris 04-06-2005, 04:12 PM What I need is a central file that can display the entire menu on each page through a simple javascript code.
Corey Bryant 04-06-2005, 04:21 PM You need something like a CMS system, using probably a server side language like PHP or ASP.
blueskyboris 04-06-2005, 04:24 PM Okay... My host does not support ASP or PHP
There is no way to do it with Javascript?
layer0 04-06-2005, 05:46 PM The simplest way would be to use an IFrame with no scrollbars. Nobody will notice. http://www.scriptomizers.com has an iframe generator.
samdax 04-06-2005, 05:54 PM Yes
You can make include with javascript
and because javascript is client side (browser suported) you do not need 'supported option' from your hosting provider.
Anyway there is no easy way to do this
If you want to include another javascript file do this
<script type="text/javascript" src="file.js"></script>
it will execute javascript code from file.js
if you want file.js output html code you should use
'document.write' for every line of your html code or writeln
example
document.writeln('<p> hello world</p>');
document.writeln('<a href="css/index.html">CSS</a> ');
document.writeln('<a href="index.html">Home</a>');
...
samdax 04-06-2005, 05:57 PM Yes iframe is very simple way, I forgot
no scrollbars and no border, nobody will notice.
the_pm 04-06-2005, 05:59 PM Originally posted by ZeonFx.com
The simplest way would be to use an IFrame with no scrollbars. Nobody will notice. http://www.scriptomizers.com has an iframe generator.
That's an excellent way to lose a lot of business and search engine traffic. There are a lot of emerging technologies that will not support frames or IFrames, most of which are being bought and used by some very desirably markets (business people, people in high-profile technology, etc.). Browsers are being made with options to ignore IFrames because they are commonly used for advertising. Search engines lose the full context of your pages because they index remotely called pages from your regular page content - you lose a lot of impact here.
JavaScript includes are even worse. You lose probably more of your audience through their unreliability, and you have to write a whole lot more code to make them work.
Both IFrames and JavaScript will prevent a lot of visitors with disabilities from using your site too. This is a concern no Webmaster should ignore.
Includes are definitely the way to go. My preference is for PHP or ASP includes (they are extraordinarily easy to implement), but SSI will work as well.
If your host doesn't support ASP or PHP, it's time to switch hosts. Even a good portion of free hosts will support one of these very basic technologies.
Ivan-Funio 04-06-2005, 08:43 PM I think is better to use a template (DWT files), if you change something there, the changes happen in the whole site.
<<Signature to be setup in your profile>>
|