Posted: Tue Jan 18, 2005 9:32 pm Post subject: Some sort of dynamic template possible?
I'm designing my website with simple HTML and Microsoft FrontPage. I made my top logo bar and side menu and then saved it as a template to use as the base for all future pages. That way I just have to add the content and I'm good to go. But on a few occasions already I've decided to make a change to my menu bar, or to change where one of the links in it leads to. This is after I have already used this template to create many other pages. Is there any way I can create a dynamic template that, once changed, automatically updates on all pages?
Another way to ask this is, for all of you who have HTML-based pages and use simple tables to set up your navigation bar on the top or left side, when you want to change something in that menu, how do you make the change to all your pages without doing it manually to each one?
Joined: 28 Dec 2004 Posts: 136 Location: Vancouver, B.C., Canada
Posted: Tue Jan 18, 2005 10:05 pm Post subject:
You can either use server side includes or use MSFrontpage's include function.
Server side include means you create a base file for your navigation, logo, etc. with just the html between the <body> and </body> tags then add the following to your template:
<?
include "/path/to/your/file/name.inc";
?>
You must name your base file ***.inc and have server-side includes enabled on your host (probably do).
Otherwise, you can use FP includes by going to "Add Webcomponent" in your "Insert" menu (I'm not sure of the names, could be something else) and choose "Includes" then choose "page".
Do your designs, save the page and voila, you're done.
Joined: 02 Jul 2003 Posts: 5809 Location: by the beach, Australia
Posted: Tue Jan 18, 2005 11:24 pm Post subject:
Do a search on Google for server side includes or SSI.
Vancouver wrote:
You must name your base file ***.inc ...
There are obviously different ways of doing this. I name my SSI files ***.txt and that works OK for me. I use them for headers, footers and navigation links.
It's wonderful being able to make one change in one file and see that change appear on dozens or hundreds of pages. _________________ Allan Gardyne
... earning a good living from affiliate programs since 1998.
Learn how.
Subscribe now FREE Affiliate Program Tutorial
Joined: 14 Jul 2003 Posts: 1744 Location: Bangor, Maine
Posted: Wed Jan 19, 2005 1:01 am Post subject:
SSI is not processed until you are loaded on the server. You could install the Apache Web Server software on your PC and let it process it there, so you can see it as you develop. But most people just put in the tags, then upload to see the final look.
There are a couple of other good topics about SSI around the forums... if you search you will find them. I know one was discussed just the other day. I think it is Eugen's post in the "Site Review" section. _________________ Eric D. Burdo They Made $6,513 a day With Clickbank Doing This...
SSI is not processed until you are loaded on the server. You could install the Apache Web Server software on your PC and let it process it there, so you can see it as you develop. But most people just put in the tags, then upload to see the final look.
I installed Microsoft's PWS server on my small Pentium with Win95, to work with PHP.
It was a bit of a pain, but it worked well for most things that weren't Apache/Linux specific - like Sendmail.
That said, it was more the keen techie in me. For small jobs, you don't need to go this route, as Eric suggested.
Hope this helps,
Charlie. _________________ "Before I speak, I have something important to say."
- Groucho Marx
Couple things you will want to check with your webhost first
1. Do they have FP extensions installed and available (some proprietary features of FP will require extensions to use the FP publishing feature to your online site and to "activate" those features so they work properly)
2. If you decide to use straight SSI instead of an FP proprietary SSI or border feature, you need to find out what page extensions your host will allow for the pages you upload ... some hosts restrict to only .shtml or .shtm and won't allow other page extensions to be used like .htm .html etc. Yes, they can be changed to allow any extension, but the question is ... will your host allow this?
Debs _________________ Learn how to turn keyphrases into quality, well-targeted articles your visitors and SE's will love with Gary Antosh's new ebook "Web Content Made Easy!"
Joined: 14 Jul 2003 Posts: 1744 Location: Bangor, Maine
Posted: Wed Jan 19, 2005 8:25 pm Post subject:
The Linux hosting on 1and1 defaults to shtml for the SSI extension. YOu can override it for other extensions if you want (using the .htaccess file). They have frontpage extensions on some of their hosting packages, not sure about all. I don't use the extensions myself. _________________ Eric D. Burdo They Made $6,513 a day With Clickbank Doing This...
So would you recommend using FP's feature or straight SSI? Which would be more convenient?
If I choose using FP's feature, I'm assuming I just create my base HMTL and upload it, then add web component, go to page, select it, and I'll see it in FP? Then just add my content?
If I choose to use straight SSI, I just add this to the bottom of my base HTML...
<?
include "/path/to/your/file/name.inc";
>
...after the </body> tag? Then I just start off each new page with...
<!--#include file="base.shtml" -->
...go to Design mode in FP, and add content from there?
Joined: 14 Sep 2004 Posts: 110 Location: Vancouver, BC Canada
Posted: Wed Jan 19, 2005 9:50 pm Post subject:
Code:
<!--#include virtual="includes/file.htm" -->
If you're comfortable using SSI rather than the FrontPage (proprietary) method of managing includes - go with the SSI method.
This way, you're not tied to any particular wysiwyg editor - making your site more scalable.
Viewing SSI offline - some HTML wysiwyg editors don't show you a proper preview when you're working on your files offline. From FrontPage (or dreamweaver, etc.) the keystroke "F12" will usually open the page to a browser window so you can see your page (and all the includes).
I would also suggest that you practice good "housekeeping" when you start with SSI. Create a folder for all your SSI files so as to keep them in a little collection. Or, use a naming convention to easily find them in an alphabetical listing. For instance, you could name them all with a prefix *i* - such as "i-menu.html", "i-footer.html" etc etc.
my 2 cents.. hope it helps _________________ Andrea Thomson
Thanks for the help. I only plan to have one include file, however: an HTML with my top logo bar, left navigation menu, right side ad bar, and bottom text bar.
I would just like to soldify what I'm doing there to make this work.
Create this "base" HTML with my top logo bar, menu, etc. Add to the bottom
<?
include "/base.inc";
>
AFTER the </body> tag. Then, at the top of each new page, add this:
<!--#include file="base.shtml" -->
or something similar, depending on my exact directories. Then enter design mode in FP, and add to that base HTML (in other words, my content).
Joined: 14 Jul 2003 Posts: 1744 Location: Bangor, Maine
Posted: Thu Jan 20, 2005 2:58 am Post subject:
Here is how I do mine. Oh, first here is a link to a SSI primer. Much of it is more than you want, but check out the "virtual" section. It is what Andrea outlined above, and is what you need to get started:
Ok, now to the layout. If you want a Logo, Left Nav, Right Side Ad and Bottom Text, that is 4 includes. Each item is its own include.
For the logo, I put all the Logo HTML into the logo.inc file (or whatever you name it). Then in your base HTML page, you put the virtual call to the file in the same place where the logo would go. When the site is processed, it pulls in the contents of that file, and they get processed as part of the master page. _________________ Eric D. Burdo They Made $6,513 a day With Clickbank Doing This...
Debs _________________ Learn how to turn keyphrases into quality, well-targeted articles your visitors and SE's will love with Gary Antosh's new ebook "Web Content Made Easy!"
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
Your host: Allan Gardyne. Earning a good living from affiliate
programs since 1998.