Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need some help with web pages.
#1
OK...I'm trying to make a web site that uses the same basic template for all the pages.
I'm have some limited knowledge of CSS and I am using it successfully so far.

I'm using an image map for the main menu on all my pages:

<map id="menumap" name="menumap">
<area shape="rect" coords="0,0, 114,19" href="index.html" onmouseover="chgImg('mHome')" onmouseout="chgImg('mHome')">
<area shape="rect" coords="0,18,114,40" href="about.html" onmouseover="chgImg('mAbout')" onmouseout="chgImg('mHome')">
<area shape="rect" coords="0,39,114,61" href="contact.html" onmouseover="chgImg('mContact')" onmouseout="chgImg('mHome')">
<area shape="rect" coords="0,60,114,82" href="calendar.html" onmouseover="chgImg('mCalendar')" onmouseout="chgImg('mHome')">
<area shape="rect" coords="0,81,114,103" href="beltreqs.html" onmouseover="chgImg('mBeltreqs')" onmouseout="chgImg('mHome')">
<area shape="rect" coords="0,102,114,122" href="links.html" onmouseover="chgImg('mLinks')" onmouseout="chgImg('mHome')">
</map>

There will probably be close to 100 pages total available for this site, so if I need to add to or modify the menu, I'll have to change EVERY single-dingle page. I just don't want to do this!

The only thing that is going to change on various pages is the argument passed to chgImg in the onmouseout event.

Is there a way I can store this HTML in one location and reference it on each page for use so I don't have to change a million pages when I make a modification?


Oh yeah, I don't want to use frames either.
Reply
#2
The only way I know of having a "template" type system is with php, asp, and frames.


If you are desperate, I think you could use javascript, but that's kinda dependant on the users browser so it might not be compatible.
<@Miagi> !8 Am I spamming?
<@ChanServ> Miagi: Yes.
<@Miagi> !8 Should I stop?
<@ChanServ> Miagi: Oh, please, PLEASE, make it stop!

Reply
#3
The only reason I don't want to use frames is because of the image I have at the top of the screen (background).

I want the whole thing to display at a minimum 800x600 resolution, but I don't want a scroll bar to appear in that top frame if the window is too small. I know I can turn the scroll bar off, but that would cut a part of the image from the display when the window is smaller than 800x600.

I am willing to use frames, in fact, I would prefer to, but it's that dang display problem.

The screens are laid out similar to this:


________________________
| HHHHHHHHHHHHHHHHHHHH|
| SSS|MMMMMMMMMMMMMMM |
| SSS|MMMMMMMMMMMMMMM |
| SSS|MMMMMMMMMMMMMMM |
| SSS|MMMMMMMMMMMMMMM |
| SSS|MMMMMMMMMMMMMMM |
| SSS|MMMMMMMMMMMMMMM |
| SSS|MMMMMMMMMMMMMMM |


so frames would work fine for that. If there was a way to only have a horizontal scroll bar for the whole screen when it's too small, that would be perfect. I just don't watn horizontal scroll bars for each frame.

A vertical scroll bar for the main frame (M) is fine, I can do that.

Hrm..i'm going to try something to see if what I'm thinking will work...
But I'm still open to suggestions.

I'm also willing to learn some PHP, and use some generic javascript
Reply
#4
You would need to use a mixture of PHP and javascript.


If you are looking for a PHP templating system I highly recommend looking at "Smarty": http://smarty.php.net/
It is a great system.
Reply
#5
If you use php, you don't need to use javascript...


I use this for all my webpages...

Well, I actually have a switch so that you can do ?page=maps, but it's basically this...

Code:
<?php

include("top.php");

include("left.php");

?>
&lt;@Miagi&gt; !8 Am I spamming?
&lt;@ChanServ&gt; Miagi: Yes.
&lt;@Miagi&gt; !8 Should I stop?
&lt;@ChanServ&gt; Miagi: Oh, please, PLEASE, make it stop!

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)