: Software for making website "includes"
iZac Jul 4th, 2006, 02:52 PM Hi, I was wondering if there is any HTML editor out there that allows you to have 'includes' as part of the code?
For example, if I want the code for the navigation menu to remain the same in all the pages of a website, then if I edit one source file, it will automatically apply the changes to all the individual webpages, without having to manually edit each one.
I think something like this can be done using PHP, but I was wondering if there was a simpler program out there that could do that? I heard that Microsoft's Frontpage has a feature like this, so I would assume that there would be some equivalent for Macs.
Any ideas?
Thanks.
g33k-fu Jul 4th, 2006, 03:04 PM What you're describing there, in essence, can be accomplished with CSS and PHP. You can include HTML pages (or other PHP pages) and if you tag them consistantly, you can use CSS to standardize the look and feel of those included pages (I am assuming you're trying to make a menu bar to look consistent across multiple pages).
My favorite editor for that would be... VI? :D
Doesn't Dreamweaver do PHP and CSS?
ArtistSeries Jul 4th, 2006, 06:10 PM For example, if I want the code for the navigation menu to remain the same in all the pages of a website, then if I edit one source file, it will automatically apply the changes to all the individual webpages, without having to manually edit each one.
Any ideas?
www.opencube.com offers free menus that work like that.
minnes Jul 4th, 2006, 06:37 PM It sure is easy with PHP and doesnot require any special editor, any plain text editor or html editor will do
just type
include "filename.xxx";
in the webpage at the position you want your updateable section to be put in.
then you just have one file to change, such as a menu or navigation links.
You can include any file in php files, but you cannot include files in html, unless you just change the extension in that html file to php, then you can just include the files like above.
CanadaRAM Jul 4th, 2006, 08:24 PM Huh? PHP is not required, as long as the server has Server Side Includes enabled, it is a simple statement
{LF Bracket}!--#include virtual="{path}/filename.htm" --{RT Bracket}
or {LF Bracket}!--#include file="{path}/filename.htm" --{RT Bracket}
Check with your ISP as to which version is correct. Your ISP may also have designated only certain file extensions to execute SSI -- commonly only files ending with .shtml -- however on the hosts I use, SSI is enabled for all .htm and .html documents, so renaming the file (and all its links) is not necessary,
More tutorial (http://hoohoo.ncsa.uiuc.edu/docs/tutorials/includes.html)
It is useful to collect all of the include source files in one directory -- I usually make one called "includes", strangely enough. If I want the client to be able to edit some text on the site without b0rking the rest of the pages, I ll make a directory called EditableIncludes and give them access to just that.
Keep in mind though, that you will have to test the results of the paths that are Included in your final pages -- if you are Including navigation, you can't use the same Include file in pages that are at different levels in the directory hierarchy, unless you make all of the paths of the links absolute.
minnes Jul 4th, 2006, 08:30 PM HI Canadaram
Sometimes they work and sometimes not, it takes trial and error.
for some reason on my website, I cant use includes on html.
but its no big deal.
But it would save editing if you can include php in html.
in that case I believe you would still need PHP tags around the php code within an html file.
So yes, you might not need to edit file extensions.
CanadaRAM Jul 4th, 2006, 08:36 PM Yeah - that's the "Check with your ISP" portion of it -- each Web server can be set with many, many different configuration choices, so what works on one (shtml vs html, SSI on or off, file extensions that will do php parsing, etc.) may be different on another server.
HowEver Jul 4th, 2006, 09:09 PM Includes are fun, the website I manage uses them.
iZac Jul 4th, 2006, 10:37 PM Thanks for the suggestions, but one problem is that i don't actually have access to the servers, or website host personally.
So, I was hoping to find a solution for includes that i could just generate on my own computer. The PHP includes you guys talked about sound promising, but I am not too familiar with it so I guess I'll have to learn how to use it. However, it sounds like the pages have to be .php -- is there any way to do it so that the pages can be .html?
Thanks!
CanadaRAM Jul 5th, 2006, 01:10 AM Thanks for the suggestions, but one problem is that i don't actually have access to the servers, or website host personally.
So, I was hoping to find a solution for includes that i could just generate on my own computer. The PHP includes you guys talked about sound promising, but I am not too familiar with it so I guess I'll have to learn how to use it. However, it sounds like the pages have to be .php -- is there any way to do it so that the pages can be .html?
Thanks!
Huh again?
What do you mean, you don't have access to the server or the host?
Can you FTP files into the Web directories? If not, how, exactly, do you propose to work this?
If you can FTP files to the web space (which WILL require the site owner's username and password) then you can utilize either the SSI or PHP approach -- but either one presumes that you know what services are available from the host.
This is not something you program on your own machine -- neither of the approaches requires the use of specialized software - just putting the code into the page with a text editor or Web editor.
What FrontPage (may it rot in #=!!) was doing was incorporating a proprietary set of extensions (FrontPage Extensions) which had to be present on the server as well.
iZac Jul 5th, 2006, 01:19 PM Yeah sorry it's confusing... here's the situation:
I am making a website for someone else, but unfortunately, they do not know the login/password for me upload all the files via FTP. (I am assuming that eventually this info will be given to me when the site is complete and ready to be uploaded).
In the meantime, I am creating the pages on my own computer. However, I am finding it difficult that whenever they request a change in the navigation menu (for instance, if they want to add a new section), then I need to change the menu system for all 20 or so pages manually. The same thing applies for other misc things (eg. they want a banner at the top of every page... but then they want to change the text, etc). It would be great if I could just make the modifications once, and have the changes applied to all the pages of the website.
I was hoping that I could just have a snippet of code like:
<include "menu.txt"> on each page, and then just edit the HTML code for the menu itself in a separate file, "menu.txt".
Is there any way of doing this all on my own machine? Perhaps there is a 3rd party program or script I can run that can generate all the pages or something like that.
ArtistSeries Jul 5th, 2006, 01:28 PM Like I said www.opencube.com
You will get a JavaScript include and two external files. One that you edit.
HowEver Jul 5th, 2006, 02:15 PM .
CubaMark Jul 5th, 2006, 03:14 PM I am creating the pages on my own computer.
(SNIP)
Is there any way of doing this all on my own machine? Perhaps there is a 3rd party program or script I can run that can generate all the pages or something like that.
You already have the capability built-in to your own machine. Just go to
<b>System Preferences-->Sharing</b>
Turn on "<b>Personal Web Sharing</b>"
Create the website inside the folder:
<b>Macintosh HD/Library/WebServer/Documents/</b>
(just toss the Apache default files in there)
(and make a handy alias to the folder in your dock or on the desktop)
You will also have to "activate" Server-Side Includes on your computer by editing one of the Apache configuration files. See <a href="http://www.oreillynet.com/pub/a/mac/2002/01/29/apache_macosx_four.html">this tutorial</a>.
I've been using this for a few years now, doing local development of our association's website. Very handy!
:)
M
CanadaRAM Jul 5th, 2006, 03:35 PM Yeah sorry it's confusing... here's the situation:
I am making a website for someone else, but unfortunately, they do not know the login/password for me upload all the files via FTP. (I am assuming that eventually this info will be given to me when the site is complete and ready to be uploaded).
In the meantime, I am creating the pages on my own computer. However, I am finding it difficult that whenever they request a change in the navigation menu (for instance, if they want to add a new section), then I need to change the menu system for all 20 or so pages manually. The same thing applies for other misc things (eg. they want a banner at the top of every page... but then they want to change the text, etc). It would be great if I could just make the modifications once, and have the changes applied to all the pages of the website.
Oh, OK, you're talking about the construction of the web site, not the serving of it. Do we assume that it will be relativley stable once uploaded?
If you have Dreamweaver, it's a piece of cake -- make a Template page with the navigation and any other common elements in it, and put in Editable Areas for all the places where the pages will have their own content. Then create the 20 or so content pages based on the Template. When the client asks for a navigation change, you update the Template, and all the pages that use that template also update. This is done purely at the construction end - so you have to re-upload every changed page to the site - but it does not rely on any server technology - the pajes are plain HTML.
I'm not familiar with other programs like RapidWeaver et al. but you can investigate them to see if they have similar template features.
PS. Next time, please describe your circumstances more thoroughly in the original post so we don't go madly off in all directions looking for solutions that aren't relevant.
Hooch Jul 5th, 2006, 06:33 PM If you're writing the HTML tags yourself and not using a WYSIWYG editor, PageSpinner has a simple include file feature.
- Hooch
iZac Jul 6th, 2006, 10:24 PM Cool, thanks so much for all the responses. It looks like dreamweaver is probably my best bet right now... but i will definitely keep the other solutions in mind for later on. I can already see them coming in handy....
| |