PDA

Click to See Complete Forum and Search --> : Website Structure



losse
08-09-2004, 11:08 AM
Hi gang
Lately I've been getting many projects that I think will warrant an upgrade in my coding skills. Let me explain my issue. One client I have is a real estate agent who, once or twice per week gets a new listing under his book. That being said, he wants to dedicate a full page with images, text and charts. Now I've been building that with HTML and that's not a problem to do but the problem comes when I have to edit the header (nav bar) or the footer. It's a process where I have to open the 40 some pages and manually edit each one.

I was wondering if there is some kind of coding language out there where I can create 1 page for the header, 1 page for the footer and then call all the "content" pages on their own. So that if I do have to add pages, remove pages or edit the header/footer, I don't have to do the changes throughout the site.

By the way, there is no database in any of these sites.

Thanks
Losse

desilva_k
08-10-2004, 02:03 AM
i also came to the same problem some time ago, it is quite difficult without a database, but you could try ASP. It has a built in filesystem object, which extracts all folders and files inside the parent folder, and you can use them to display files and folders. For example, if you have 2 folders with three .htm files, you can display them like:

folder1:
file1.htm
file2.htm
file3.htm

folder2:
file1.htm
file2.htm
file3.htm

So all you have to do is save the files in appropriate folders, and the navigation is built by the asp page. For example, if you save a new file in folder2 as file4.htm, and view your page again, it will look like:

folder1:
file1.htm
file2.htm
file3.htm

folder2:
file1.htm
file2.htm
file3.htm
file4.htm

this solution may not be what you are looking for, but if you are hosting on a IIS 4.0 server, I highly recommend it.

If you would like more information, i recommend you visit http://www.w3schools.com/ goto asp tutorials and read the "filesystem object" section.

kds,

XcVbSdRw
08-10-2004, 03:17 AM
1) if you are using Dreamweaver you could use code snippets for the footer and header. that way when you edit the snippet it changes it everywhere in the site automatically.

2) another way Dreamweaver would help is it lets you execute the Find And Replace on all files in a folder. so you could easily code your headers and footers to allow you to replace them in this fashion.

3) or, you can use ASP and simply make the header and footer into separate pages. then in each content page include the header and footer pages where you want them.

losse
08-10-2004, 09:49 AM
Are there any PHP tutorials on file web layout out there? Essentially this is what I am looking to do:

______________
| A |
______________
| |
| |
| B |
| |
|_____________|
| C |
______________

So A would be my header file (say header.htm) B would be a content file and there will be many many of these. and C would be my footer file.

So, ideally I would like to find an ASP or PHP tutorial that would allow me to set up this structure to my site and modify it somewaht in the event I'd want a side nav menu etc..etc...

Thanks

XcVbSdRw
08-10-2004, 08:49 PM
it is really very simple...

1) create a text file called header.asp and put the following in it,

<html>
<head>
<title><%=PageTitle%></title>
</head>
<body>
<p>This is my header</p>

2) create a text file called footer.asp and put the following in it,

<p>This is my footer</p>
</body>
</html>

3) create a text file called content1.asp and put the following in it,

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<% PageTitle = "Page Title for this Content Page" %>
<!-- #INCLUDE FILE="header.asp" -->
<p>This is my content</p>
<!-- #INCLUDE FILE="footer.asp" -->

4) put all three files on your server and whenever anyone calls content1.asp it will automatically include header.asp and footer.asp

5) add as many contentX.asp files as you like just always retain the include statements

6) you can change the header.asp and/or footer.asp files and every contentX.asp page will now use the new files

losse
08-11-2004, 08:26 AM
XcVbSdRw
Your teaching ability is unlike any I've seen. Thank you for simplifying the process.

losse
08-11-2004, 08:54 AM
I have a follow up question if you don't mind.

How does the "content1.asp" page know how much space (height and width) to dedicate to header.asp and footer.asp?
Thanks

losse
08-12-2004, 04:52 PM
Does the size of the header.asp file matter? or does it simply post the code that lies within the <html>...</html> tags?

kronk
08-23-2004, 11:26 AM
hi there, just a thought - why don't you try php/mysql... you could store all the info in a mysql database, then set each page with header/footer tags and run a query to extract info from databse then print on screen, a mate has a travel agent site that he works on and is had this exact same problem. with some clever mysql structuring he takes no time at all to do the updates, and if you really want you could set up there site to allow the real estate to update for themselves... but why do that when it robs you of the $$$

remember, just a thought...