Hey guys i am developing a site in which i want the main logo & the navigation bar & the side menu to be the same in all the 100 's of pages i will write. (This is because i have to add a new topic everyday!.)
The steps i took :
1. I used dreamweaver to build this project.
2. I created a file :-
3. Now i included the a.shtml file in a sample file, say
To do this i gave the following code in the head of sample.shtml.
It worked & the contents of a.shtml can be viewed in sample.html (only in dreamweaver not in browser because SSI cammands dont work with any browser)
The tragedy begins
4. Now i want to edit sample.html further containg the details of the product.
But i was not able to do this.
What i want from you
1. Is thr any other way for keeping my menu navigation, haeder same throughout the site
2. Can we preview the ssi pages is brower
3. Why i am not able to edit sample.html further.
If your host supports php (Frihost does) then you should use this:
This will include everything in the file. For example:
In FILENAME.html I have:
then the place where you put that code would have somewhere:
PHP is not good to include full HTML in other HTML because in that case you will have doubled tags (HTML and BODY) what is not good type of coding. I am prefer iframe for HTML pages and PHP for PHP or part of HTML code (but not full).
Ah yes, totally forgot about the Iframe. Yah thats also possible. Thanks for reminding me.
ya thank you all but is thr any way to see included pages in any browser.
And my second question :- is it possible to maintain menus & header by any other way!
I frame canot be use for menu! Because when we include a menu using i frame, & when some1 click on the link in menu that page gets open in the frame only, not on the browser!
A am not sure but this problem is in target. Try in menu for <a > definition set:
target = "_top"
You don't need big reed letters for your questions.
You should be careful about using an iframe to display a menu, particularly as if the menu has drop downs, the dropdown will not appear outside the confines of the frame it is placed in. This is a classic case for using SSI.
HTML PAGE WILL BE SOMETHING LIKE THIS
and your nav.php page will be something like this
I believe the page from which you are including files from (sample.html), requires a .shtml suffix.
I didn't know that I have to say. I though you could include any type of file, including simple text files. Having said that, I've only actively used ASP SSIs as I have never had a host that supports PHP before.
I don't like using iframes for including in this way, mainly because of the cross browser issues with setting zero borders on an iframe.
gr8ankit didn't exactly explain what hi/she want. Of course if he/she have drop down menu it is not good to use iframe. I have idea that he/she want to include full html page in other html page (template).
I use the php include function and there is no problem at all. If you don't want doubled tags just code the included file in php
I know it is possible to include part of HTML to another page without any problem, but gr8ankit asking for including full HTML page (how I understand his question). If I am wrong, sorry...
There shouldn't be a problem having "double tagging" as you call it, because in the page itself, only the iframe tag will show. That really isn't anything to worry about
Also, I usally never include my <body> and <html> in my .php codes, thats if im using
I don't think this really makes a difference. But, my php codes work anyways.
Hey thank you all. I read all the topics, now i got the final solution to it.
My problem was updating the navigation bars! I solved it by making them in flash, now i dont need the above techniques. Now if i want to update my menus, i just have to upload the swf file to the server & all my pages will be updated with a sin gle file. Still very thankful to you all.