Go Back  HTML Forums - Free Webmaster Forums and Help Forums > WEBSITE DEVELOPMENT > All Around Tutorials
User Name:
Password:
 

Reply
Thread Tools   Display Modes
  View First Unread
 
Old 10-31-2003, 12:30 AM
  #1
entimp
I Quit WoW - Gimme Rep.
 
entimp's Avatar
 
Join Date: May 2002
Location: Liverpool UK (sometimes London)
Posts: 4,897
iTrader: (0)
entimp will become famous soon enough
SSI Server Side Includes Tutorial. Pt 5: Yay it is all over.

Intro - Pt 2 - Pt3 - Pt4 - Pt5

Okie dokey... so we now have the includes we need. These are:
meta_and_header.asp
nav.asp
before_content.asp
after_content.asp
end_page.asp

You saved these to a folder called 'includes didn't you? No? Then go do it now!

Back? Good! Then let's make our fist web page that uses
SSI's. This will be an index page for the very simple
website we are creating.
Open your design tool of choice... notepad or dreamweaver
for example. Save this file as index.asp, remember the asp
extension or the server will not read it before it gets sent.

Now you have a blank doc, we need to add some includes. The
first one will be 'meta_and_header.asp, and then add the
rest. It will look like this:
Code:
<!--#include file = "includes/meta_and_header.asp" -->
<!--#include file = "includes/nav.asp" -->
<!--#include file = "includes/before_content.asp" -->
<!--#include file = "includes/after_content.asp" -->
<!--#include file = "includes/end_page.asp" -->
All things being equal, that I lead you down this strange
path correctly and you did as I said... the instructions
above saved as index.asp will render you a perfectly valid
web page. Without the content or footer areas being empty
that is.

That isn't good is it? Well it is to an extent. I now want
you save this file as my_template.asp so that when you add
content all you need do is refer to this file.


So back to index.asp, open it and some content of your
choice.
Code:
<!--#include file = "includes/meta_and_header.asp" -->
<!--#include file = "includes/nav.asp" -->
<!--#include file = "includes/before_content.asp" -->

Shock Horror the content goes here! You would have never 
worked that out would you! You can add what ever you want, 
plain text, or normal markup (html), even scripts.


<!--#include file = "includes/after_content.asp" -->

You can do the same here for the footer region... 
alternativly you can create custom content, save it as an 
ASP file and serve it as another include. This seems to be 
awful lot of work for a simple page doesn't it... well hang 
in there.

<!--#include file = "includes/end_page.asp" -->
Now create the files:
biologists.asp
links.asp
article.asp
gallery.asp

Add the content to the template you made and save it as one of the above. Remember your content can be saved as another include, and not just written into a template page. Remember when writing your links you are directing the anchor at one of the files above and not the individual include files. I hope that makes sense.

Now send all your files to your ASP enabled server, remember you cannot run these to test from your home computer. Once uploaded you should be able to test them.

I hope that gets you off and running and that if I have missed something crazy out you will roast me for it... politely of course.

It has been a while since I got round to wrapping this all up. It wasn't for Peg nagging me (in a polite and constructive way ) like my mum would have I wouldn't have got my lazy finger out and got this out of the way.

So a big thank you Pegasus.

I will of course edit this as I go along to clear up any confusion I have may have put in your direction. This can only be done if you reply and point it out to me in the relavent thread.

So there ya go! Hope this kinda helps and puts a few of you on the path of more confusing and screwed up web design.


Intro - Pt 2 - Pt3 - Pt4 - Pt5
__________________

Last edited by Horus_Kol : 08-26-2008 at 05:38 AM. Reason: navigation
entimp is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 10-31-2003, 01:14 AM
  #2
Pegasus
Extremely Flighty Admin
 
Pegasus's Avatar
 
Join Date: Nov 2001
Location: 35º South of Santa Claus
Posts: 21,465
iTrader: (0)
Pegasus is a name known to allPegasus is a name known to allPegasus is a name known to allPegasus is a name known to allPegasus is a name known to allPegasus is a name known to all
You're quite welcome, Entimp. *lol* Although, I don't think it was the nagging so much as the constant "dumb questions" coming from me that prompted you to finish. Self-preservation and all that.

Okay... that could be where I went wrong.

I don't have a folder called "includes". Of course, none of my links refer back to an include folder, either, and they seem to work.

What I have for a hierarchy is:

Main Site Folder
hindex.asp (the header file for the index page)
index.asp
commnav.asp (a nav file that's common to most of the sections, but not all)
Section Folder
>>csection.asp (content for section's main page)
>>hsection.asp (header for the section, including all the meta tags, etc.)
>>nsection.asp (navigation for the section, if necessary)
>>section.asp (the intro page for the section)

Each section has this set up, as well as the individual contents of each new 'page'. And that's where I'm having problems.

Having what amounts to 2 pages for content - the content itself and the combined page, gets a bit awkward. What I tried to do was have the page links for the section come up in an iframe in the 'csection' page. <sigh> But that only works sometimes, and not if I specify the source of the iframe as a page. The content comes up in a separate window.

Except in one case where I put the content into a table that fits into the iframe. That works. I should maybe add a table to the other content pages?

If nothing else, Entimp, you've taught me a new way of looking at web pages. Having to break things down for an asp file makes me think more about how to arrange the site, what's vital and what isn't.

<groan> And once I get this headache with the iframe pages sorted out, it'll be a whole lot easier to add pages to my site. I'll only have to update 2 pages - the navpage for that section and the 'Updates' section on the main page - rather than 3 or 4 pages, plus creating an entire new page for whatever I'm adding.

Thank you ever so much!

Peg
__________________


Decaf is the root of all evil...
HTMLForums Awards 2008
Pegasus is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 10-31-2003, 01:28 AM
  #3
entimp
I Quit WoW - Gimme Rep.
 
entimp's Avatar
 
Join Date: May 2002
Location: Liverpool UK (sometimes London)
Posts: 4,897
iTrader: (0)
entimp will become famous soon enough
No problem at all glad it helped.

By having a folder called includes you efectivly have another level order amongst the chaos. You will know where the files are it is easier to mentally design the web page with such order before putting the files into practice.

One way I find that makes it easier to decide what is an include and what is not is to write a generic page in html as I did in the tutorial. A page that would fit every page in your site.

I then extract all the generic components that would become includes and save them as such. It is then just a case of naming them with a convention you are happy with, creating a template file with the includes and then creating pages as and when you need them by filling in the blanks as it were.

Table structures are good for this as you can control the size and layout of the page and they have very clear points to start and terminate given includes. That was why I used it in the tutorial but alas didn't make a point of this.
__________________
entimp is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 10-31-2003, 01:52 AM
  #4
Pegasus
Extremely Flighty Admin
 
Pegasus's Avatar
 
Join Date: Nov 2001
Location: 35º South of Santa Claus
Posts: 21,465
iTrader: (0)
Pegasus is a name known to allPegasus is a name known to allPegasus is a name known to allPegasus is a name known to allPegasus is a name known to allPegasus is a name known to all
<sigh> That's my problem. There is no 'generic' page for the entire site.

Each section has a generic page, yes, with different meta, title and header image information for each section, but only the layout and colour scheme is the same for all the pages.

The only problem with having an includes folder is that most of the pages would be 'includes', and divided into sections.

Or, as you have in your example, I could make an includes folder for the header and nav files and add them to the content pages. Work back from the content, as it were, rather than down from the section. Hmmm... I'll have to think about that.

*lol* I do love to complicate my life, don't I?

Peg
__________________


Decaf is the root of all evil...
HTMLForums Awards 2008
Pegasus is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 11-01-2003, 03:55 PM
  #5
giz
Is that code valid?
 
Join Date: Oct 2002
Location: UK
Posts: 3,101
iTrader: (0)
giz is on a distinguished road
Since the <title> and meta description are unique to each page, I do not put that information in the include file. I put it in the main file where the page content also resides (i.e. in the page that has the include directives within it, those then calling the other files in).
giz is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 12-10-2003, 12:46 AM
  #6
Jason20
Aspirant (Level 2)
 
Jason20's Avatar
 
Join Date: Dec 2003
Location: LaPorte, Indiana
Posts: 14
iTrader: (0)
Jason20 is on a distinguished road
Thumbs up

Hey great tutorial. Worked great for me. Gonna save LOADS of time.
Jason20 is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 12-10-2003, 12:59 AM
  #7
entimp
I Quit WoW - Gimme Rep.
 
entimp's Avatar
 
Join Date: May 2002
Location: Liverpool UK (sometimes London)
Posts: 4,897
iTrader: (0)
entimp will become famous soon enough
Glad it makes sense and works for you. Any improvements or questions then fire away.
__________________
entimp is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 02-21-2004, 05:31 PM
  #8
sh00ter555
Champion (Level 13)
 
sh00ter555's Avatar
 
Join Date: Nov 2003
Posts: 240
iTrader: (0)
sh00ter555 is on a distinguished road
OK, you thought i was bad before, but now wait to u read this reply.

Ok, i think i was lost completely on this part.(part5).

So let me tell you what i think i understand, and then maybe u can just fill in the parts i didnt understand.

So i have all these files saved in a folder called 'includes'
Quote:
meta_and_header.asp
nav.asp
before_content.asp
after_content.asp
end_page.asp
ok, so now i understand i need to save this file below as index.asp:
Quote:
<!--#include file = "includes/meta_and_header.asp" -->
<!--#include file = "includes/nav.asp" -->
<!--#include file = "includes/before_content.asp" -->
<!--#include file = "includes/after_content.asp" -->
<!--#include file = "includes/end_page.asp" -->
ok, if thats right then i understand i save this file again as 'my_template.asp' correct?

ok if that is alright then im confused here:
Quote:
Now create the files:
biologists.asp
links.asp
article.asp
gallery.asp
what exactly am i sopposed to make these files for? are these files above what i want to be displayed? Can i change them if this is what they are for?

Pretty much after that im lost.

can u please fill in the steps i missed or missunderstood?

Thanks again, and i think u did an excellent job on ur tutorial, and i appricate all the work you went thruogh to accomplish it. I think it may just be a little to advanced for me, but with your help i think i can figure this out.

Jason
__________________
Visit my work site that i made:
Valentino's Take n' Bake Pizza
or visit my fun site that i made when i was bored:
MyFlashAnimations
sh00ter555 is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 02-23-2004, 09:19 AM
  #9
entimp
I Quit WoW - Gimme Rep.
 
entimp's Avatar
 
Join Date: May 2002
Location: Liverpool UK (sometimes London)
Posts: 4,897
iTrader: (0)
entimp will become famous soon enough
I missed these... I'll come back at ya tonight on them. Busy on my site then sleep
__________________
entimp is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 02-24-2004, 12:39 AM
  #10
entimp
I Quit WoW - Gimme Rep.
 
entimp's Avatar
 
Join Date: May 2002
Location: Liverpool UK (sometimes London)
Posts: 4,897
iTrader: (0)
entimp will become famous soon enough
Ok you save a template so that you don't lose this file. It makes it easier when you come back and add more content. You simply open this file and edit it.

The reason you create the other files: When you click a link to another part of your site... it needs to be a page built up with the includes, the only thing that changes is the main content.

IE the link 'biologists' will lead to a page called biologists.asp which is built up of the includes.

You have to understand this is saving you time in the long term. So when you change the layout in the nav include the biologists.asp page is automatically updated.

Does that help?

And of course you can change the names... the above tutorial used an example called 'biologists for newbies' I think, and thus the file examples were tailored for that.
__________________
entimp is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 02-24-2004, 07:02 PM
  #11
sh00ter555
Champion (Level 13)
 
sh00ter555's Avatar
 
Join Date: Nov 2003
Posts: 240
iTrader: (0)
sh00ter555 is on a distinguished road
Thank You

Yes, that helps, if i have any other questions ill post them on here.

PS: i was talkin to one of my friends and he said you can do this by using normal html. He said this code work work just as well:

Quote:
<html>
<head><title>Jason's Table</title></head>
<body>
<center>
<table width="750" border="1" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
</tr>
</table>
</center>
</body>
</html>
What do you think of this code? Will that work just as well?
__________________
Visit my work site that i made:
Valentino's Take n' Bake Pizza
or visit my fun site that i made when i was bored:
MyFlashAnimations
sh00ter555 is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 02-24-2004, 07:10 PM
  #12
pyrexyn
Lord (Level 16)
 
pyrexyn's Avatar
 
Join Date: Jun 2002
Location: Monroe, New York
Posts: 622
iTrader: (0)
pyrexyn is on a distinguished road
Thankyou very much entimp. I used to stay away from ASP because it seemed like a language as complex as Java or something. So let me get this clear: ASP is simply a way of putting data together and whatnot? If I know PHP (which has includes and stuff), ASP shouldn't be a problem? And saving a file as *.asp does not do anything at all except render it as a type that can be accessed by the asp server? (Not exactly sure what if my question is even valid, because I don't know asp)
__________________
PyreXyn
http://www.xdemi.com
pyrexyn is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 02-24-2004, 08:25 PM
  #13
entimp
I Quit WoW - Gimme Rep.
 
entimp's Avatar
 
Join Date: May 2002
Location: Liverpool UK (sometimes London)
Posts: 4,897
iTrader: (0)
entimp will become famous soon enough
Shooter that layout is fine.

Remember you are breaking up the table in different includes for one reason.

Say you have 30 documents using the same header and footer. You may want to change the content of the the header/footer. Now instead of doing each file individually... you only have to change it once in the includes.
__________________
entimp is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote

Reply
KEEP TABS
SPONSORS
 
Boxedart
 
 


 
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
  
 
 
 



 
  POSTING RULES
 
 
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Thread Tools
Display Modes

Forum Jump

 

All times are GMT -5. The time now is 09:13 PM.

   

Mascot team created by Drawshop.com

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.

Server Monitoring by ENIACmonitor 0.01
HTMLforums.com © Big Resources, Inc. Web Design by BoxedArt.com
vRewrite 1.5 beta SEOed URLs completed by Tech Help Forum and Chalo Na.