RSS Forums RSS
Please support our Site Layout and Usability advertiser: Internet Marketing Services
Views: 6270 | Replies: 18
Reply
Join Date: Jun 2004
Location: Hemet, CA
Posts: 429
Reputation: FC Jamison is on a distinguished road 
Rep Power: 5
Solved Threads: 18
Colleague
FC Jamison's Avatar
FC Jamison FC Jamison is offline Offline
Posting Pro in Training

Re: Can I use a template html page within another html page

  #11  
Sep 7th, 2006
Yeah...without some type of server-side programming, the only way I know of to do that is with frames.
Reply With Quote  
Join Date: Dec 2004
Posts: 49
Reputation: rus is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
rus's Avatar
rus rus is offline Offline
Light Poster

Re: Can I use a template html page within another html page

  #12  
Sep 7th, 2006
It's actually pretty simple. I found a good tutorial that will help:
http://www.tizag.com/phpT/include.php
Reply With Quote  
Join Date: Jun 2004
Location: Hemet, CA
Posts: 429
Reputation: FC Jamison is on a distinguished road 
Rep Power: 5
Solved Threads: 18
Colleague
FC Jamison's Avatar
FC Jamison FC Jamison is offline Offline
Posting Pro in Training

Re: Can I use a template html page within another html page

  #13  
Sep 7th, 2006
Originally Posted by rus View Post
It's actually pretty simple. I found a good tutorial that will help:
http://www.tizag.com/phpT/include.php


That does look pretty simple...

...and this doesn't reload the menu.php file every time a new page is loaded?
Reply With Quote  
Join Date: Dec 2004
Posts: 49
Reputation: rus is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
rus's Avatar
rus rus is offline Offline
Light Poster

Re: Can I use a template html page within another html page

  #14  
Sep 7th, 2006
I'm not an expert, but I don't think it does. One thing it doesn't make clear is that the file that you want included should be stripped of the all tags except what is needed to format the page. So the example they show you would remove the HTML and BODY tags.
In other words, remove all tags before Body and after /Body except any JavaScript that controls mouse over, etc.
Reply With Quote  
Join Date: Oct 2006
Location: Sofia, Bulgaria
Posts: 224
Reputation: Rhyan is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 20
Rhyan's Avatar
Rhyan Rhyan is offline Offline
Posting Whiz in Training

Re: Can I use a template html page within another html page

  #15  
Oct 27th, 2006
Originally Posted by Vicksley View Post
Hi all,

What I am trying to achieve, but have no idea how to go about it, is

I want to use a template banner/navbar/ that I have created myself for all pages on my site.

Is it possible to add a "include file" into my html pages so that if I need to change one thing on the navbar or banner page I should only have to do it once via the template page instead of having to do it on every page in the website.

I am hoping to do this without using a database or frames, maybe using javascript instead.

I am using dreamweaver 8 to create my site and I wanted to first get this right before I get on with the whole site.

I was also hoping to make the page load quicker by achieving this, so that it looks as though only the content is changing......

I am not sure how to go about this ....

Can anyone help me out by maybe shooting me in the right direction with some javascript code....where to place it and the call function to achieve it..

Do I have to save the template file as a js file??

Anyway I will leave it out there and see what you guys can come up with for me....

Thanks

Vick


Hi there.
All solutions for your problem listed below seem to be OK, however, the easiest way to do it is using css. If the banner you want to place shows the same way on every page, you should just make something like this :

<div id="banner">&nbsp;</div>
and add the following css to an external file
#banner {
width=banner width;
height=banner height;
background-image: src"path/to/your/banner.jpg";
backgrount-repeat: no repeat;
}
then just copy the <div> element on every of your pages.

The second way is to create a template in dreamweaver. Dreamweaver has its own template engine, so once you setup your template and apply it to all of your pages, once you change the template, all your pages will update.

If you don't know how to do a template, there is a tutorial in Dreamweaver and it is really good and simple.

The last option is using javascript or php to set it up, however I see that other guys have already explained it.
Good luck!
Reply With Quote  
Join Date: Aug 2006
Posts: 6
Reputation: Vicksley is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Vicksley Vicksley is offline Offline
Newbie Poster

Re: Can I use a template html page within another html page

  #16  
Oct 30th, 2006
Thanks...

But I have done all that...using css...

nevermind......what I was tryin to acheive I think I need to use php....but dont want to.....lol

So...I will just stick to the css I think.....

thanks anyhow...
Reply With Quote  
Join Date: Feb 2007
Location: Ukraine, Nikolaev
Posts: 4
Reputation: Shu is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Shu's Avatar
Shu Shu is offline Offline
Newbie Poster

Re: Can I use a template html page within another html page

  #17  
Feb 11th, 2007
Hi! I had the same problem sometime ago.
Then I just found a PHP book and there are some appropriatable functions as guys have already said: they are and .

E.g.: I have the main page index.php with the code in it:
<?php
 if (empty($c)) {
    readFile("a.htm");
    } else {
    readFile("$c");
} ?>     

I use it in my own site. It's pretty simple and works. Minus - title of page is unchangable. But I coped with this.
Reply With Quote  
Join Date: Apr 2007
Posts: 9
Reputation: webdesign buddy is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
webdesign buddy webdesign buddy is offline Offline
Newbie Poster

Re: Can I use a template html page within another html page

  #18  
May 1st, 2007
Hey guys,

Here is a PHP solution for that from Alistapart, check this link: http://www.alistapart.com/articles/keepingcurrent/

This is not just for navigation. PHP include or require_once function can also be used to insert external HTML file (code of your navigation, footer, banner, etc.) in your markup. With this, updating menus, footer, banner, etc. in your pages can be done by just editing one file -- no database, no javascript, only simple PHP function and HTML. Hope this would help.

Your web design buddy,
www.bryanregencia.com
web design | web usability | information architecture | CSS | XHTML
Reply With Quote  
Join Date: May 2007
Posts: 30
Reputation: azzu5 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 2
azzu5 azzu5 is offline Offline
Light Poster

Re: Can I use a template html page within another html page

  #19  
May 9th, 2007
Hi,

why don't you try JavaScript and XML..

Put your all content in xml file then load this xml file through javascript where you want on your page.

Look for some tutorial how to read xml file you will get lots of resources....

Cheers
Looking at my own code of Life and thinking what the hell is this....
------------------------------------
Middle East B2B Marketplace
Dubai Web Design
Dubai SEO
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 5:03 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC