Forum Moderators: open
I have a site where the navigation is reapeated on all html pages (static code within each .html file). Footers are also repeated on all pages. Problem is, I want this code to be centralised - could use SSI or convert to .shtml (much easier to maintain), but ideally I dont want to change the file names due to Google indexing.
Please advise. Thanks
Might involve a little more work the first time around to ensure all your pages have the same header and footer, but no worse than turning on ssi... which I have never used because not all hosts provide it.
For the name of the program, I use Cute Html.
The method chosen in previous posts would not be allowed by my host who have a "call a spade a spade" attitude towards these things and don't want server load wasted by parsing every page for php or ssi that isn't there.
Now I'm in the process of redesigning my site in XHTML strict and pure CSS (yeah!). It just struck me that I should find a way of including the repetivive code for the navigation -- as said before, just one file to make errors in. All pages are static html, anyway.
But from what I read here and elsewhere, that would mean that I have to rename all my pages to *.shtml.
So, with my limited technical abilities, no hands-on access to the hosting server and the prospect of asking the hosting company to YET AGAIN create half a zillion 301 redirects on their server, is there any other way of doing this?
I just ran a check with a test file and find that .htm and .php files will be included just fine, but only if the calling file has the .shtm extension.
Am I back in the navigation-in-all-the-individual-html-files scenario?
Any comment welcome.
cheers
teylyn
So, with my limited technical abilities, no hands-on access to the hosting server and the prospect of asking the hosting company to YET AGAIN create half a zillion 301 redirects on their server, is there any other way of doing this?
You could always use FrontPage includes...
<!--webbot bot="include" u-include="http://www.example.com/nav/top.asp" tag="body" --> As long as the server has FP Extensions installed, the above code will work just fine. You'll need to familiarize yourself with using FP includes as they are set up a little differently than SSI. An FP include contains all of the <head></head> data that a normal page contains. In fact, it is a normal page with the exception that it only contains the elements you are including into other pages.
I was going to say search WebmasterWorld for FrontPage Includes because I have a tutorial floating around here somewhere but the search is not working yet. :(
FrontPage Includes - Tutorial for Building FP Included Content [webmasterworld.com]
I ran the test, but, alas, the server apparently does not support FP extensions.
Just out of curiosity (since I'm not a Frontpage user, originally from the Dreamweaver camp but now happy with hand coding), tell me please: will only the tag identified in the calling page be included in the html of the page or will the whole header section be included too?
cheers
teylyn
Just out of curiosity (since I'm not a Frontpage user, originally from the Dreamweaver camp but now happy with hand coding), tell me please: will only the tag identified in the calling page be included in the html of the page or will the whole header section be included too?
When the FP Extensions are installed, the FrontPage <webbot> functionality is available. FP uses a very similar process to SSI but in its own unique way. The only content that is included in the page is that between the <body></body> of the include page. I spell this one out in the tutorial above. If the FP Extensions are not installed and you use the above <webbot> for an include, you will then see multiple <head></head> (one for each include) elements as the Include Page component does not function without the Extensions.
What's nice about the FP Include Component is that it functions pretty much without fail (if set up properly) and provides the same functionality that SSI does without having to get the Server Administrator involved, nor do you have to deal with changing file name extensions. Your include files can be of any file type. You just drop those include tags wherever you need them and presto, you've got instant SSI. :)
Keep in mind that if you are using .asp pages, then your includes files will be .asp. If you are using .htm, then your include files will be .htm. Keep them matched up. In all actuality, if you were using FrontPage and had an .asp include file on a .htm page, it would display a component error. So, it is best to keep everything matched up.
My ISP made some changes on their server, so I can now #include with *.htm pages as well.
Thanks, pageoneresults for your help.
One question for clarification, though: If I #include html code, this code will be picked up by the search engines, won't it? So, if i put my navigation in a separate file and use #include to place it on the page, the bots will find the links to the other pages that are in the included code, I hope.
Some confirmation would be great.
cheers
teylyn
Thanks, pageoneresults for your help.
lol! Did you show them this topic? They probably saw that I was recommending FP Extensions be installed and they had a fit, huh? Snicker, snicker, snicker.
Yes, your included content will get spidered barring any other html issues that may be present. What you see when you view source at the browser is what the spider sees.