| | |
Can I use a template html page within another html page
Please support our Site Layout and Usability advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Aug 2006
Posts: 6
Reputation:
Solved Threads: 0
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
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
•
•
Join Date: Aug 2006
Posts: 6
Reputation:
Solved Threads: 0
Yea.....that is kind of what I was hoping to do.....
Is it possible that you could help me with some of the coding for adding that page.......
as I do know that it can be done......Just not HOW to do it......... Could someone point me in the right direction of where to find the correct coding....as I am lost to the amount of info to look through on the net...
Thanks Vickie
Is it possible that you could help me with some of the coding for adding that page.......
as I do know that it can be done......Just not HOW to do it......... Could someone point me in the right direction of where to find the correct coding....as I am lost to the amount of info to look through on the net...
Thanks Vickie
PHP Include, I think this is what you're looking for, basically, you give this script, and you have index.php but that ONLY has the template, and the PHP Include script, PHP Include is easy to learn, and there is a GREAT tutorial at xndesigns.com, anyways, you say what your layout looks like, give all the coding, ect. but where you type text, you put in the script, and you say what the main page is gonna be, and what all the other pages are (you MUST have whatever.php if you want that to be a page, and it MUST be a PHP extension) , and now you have it so the links could be ?go=whatever or ?page=whatever, you get to decide that part too, i know, im confusing, Just go to XNDesigns already, lol
Please help get my computers connected through an ethernet cord!
php is beyond my little brain at the moment...
for a banner...the quick and dirty javascript is
basically whatever you would put on the html page, you enclose in
You the just relace your html code with
Let me know if you need more detail.
for a banner...the quick and dirty javascript is
document.write('<a href="bannerLink.htm"><img src="yourImage.jpg" /></a>');basically whatever you would put on the html page, you enclose in
document.write(' '); in the javascript file.You the just relace your html code with
<<script type="text/javascript" src="yourScript.js"></script>Let me know if you need more detail.
•
•
Join Date: Aug 2006
Posts: 6
Reputation:
Solved Threads: 0
Arggggg......
Thanks Deacon.....
that was sort of what I was after...and I did get some results with what you gave me.....
But not the result I was hoping for....I did get the images to load using the javascript...But I have CSS attatched to the html banner page and was kind of hoping that the whole page would load with the CSS attatched to it....Not just the images....
Thanks also to The geeky kid....but I havent had much experiance as yet with PHP......maybee I need to look into more of that....But I think that may include databases doesnt it?
Back to punching in more code for me....
Thanks guys.....any other help you may think of I would be glad to recieve the advice..
Vick
Never mind....I will try and play with it a bit more to hopfully get the result I need....
Thanks again for the codeing though......It did help....I could always just creat one image file instead of using three images and CSS....
Thanks Deacon.....
that was sort of what I was after...and I did get some results with what you gave me.....
But not the result I was hoping for....I did get the images to load using the javascript...But I have CSS attatched to the html banner page and was kind of hoping that the whole page would load with the CSS attatched to it....Not just the images....
Thanks also to The geeky kid....but I havent had much experiance as yet with PHP......maybee I need to look into more of that....But I think that may include databases doesnt it?
Back to punching in more code for me....
Thanks guys.....any other help you may think of I would be glad to recieve the advice..
Vick
Never mind....I will try and play with it a bit more to hopfully get the result I need....
Thanks again for the codeing though......It did help....I could always just creat one image file instead of using three images and CSS....
•
•
Join Date: Aug 2006
Posts: 6
Reputation:
Solved Threads: 0
•
•
•
•
The css should kick in once the page is written.
Give the banner image an id and write the css for it.
Ahhhh......I must not be getting it .....actually it is doing the one thing I wanted.....Giving me the banner page across every page on the site....and giving me the one file to edit if I need to.....But I am thinking now javascript may not be what I am after as it still shows the page reloading around the same time that a normal html page does.....ie.as in flashing the banner rather than giving the affect of not moving at all...
I know I am not making much sense....but I know what I want to do....I just am not explaining it well enough......I just like to be difficult...and have it all work the way I want....and expect all to know what I am on about...lol
What I really wanted is the whole banner html page to load into the other html with all the content still in it....such as the banner Css and all the banner graphics that are attatched to the banner.html....
But I have a feeling that it wont all write into it.....
Dont worry...I will work it out....I wont sleep till I can get it right...LMAO...
Thanks Deac....Youve been a gem
Vick
The best way to do what you need is either with PHP if you are on a Linux server or ASP if you are on a WIN based server.
They both work in the same way, without using a database. You simply create your header/navigation as a seperate file. Then in each of your pages you place the include code where you want the header/nav to appear.
This is the broad explanation of how it works, but hopfully it will lead you in the right direction. There are tons of tutorials online that will tell you exactly how to do this.
Good luck!
They both work in the same way, without using a database. You simply create your header/navigation as a seperate file. Then in each of your pages you place the include code where you want the header/nav to appear.
This is the broad explanation of how it works, but hopfully it will lead you in the right direction. There are tons of tutorials online that will tell you exactly how to do this.
Good luck!
![]() |
Similar Threads
- How to add tables in HTML page dynamically? (HTML and CSS)
- Open an html page from within flash flv? (Graphics and Multimedia)
- How To Hyperlink Normal HTML page with ASP.NET Page? (ASP.NET)
- Inserting (large) flash banner in HTML page (HTML and CSS)
- Print HTML page / download updates (VB.NET)
- PHP in a html page? (PHP)
- Calling function to add HTML to the page (ASP.NET)
Other Threads in the Site Layout and Usability Forum
- Previous Thread: Spry Menu not working in IE
- Next Thread: Site Redesign evaluation please
| Thread Tools | Search this Thread |
blogging content customer design development dreamweaver duplicate email evaluation filesharing firefox flash gilbane google html itunes javascript kazaa layout music napster peertopeer photoshop remote remoteserver satellitenavigation satnav server site tables template tips tomtom url wave web website websitedesignreview web_development web_sites





