HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
Adding a .shtml menu to save time.
Post new topic   Reply to topic    HTML Help Forum Index -> SSI
View previous topic :: View next topic  
Author Message
ANNIHILATOR1



Joined: 01 Jun 2007
Posts: 3

PostPosted: Fri Jun 01, 2007 5:12 am     Adding a .shtml menu to save time. Reply with quote

Hi guys,

I am fairly new to HTML and am working off my own head learning from the internet. I have built a website with various pages using basic HTML. I have been adding code to every page for my menu to appear on every page exactly the same.

I have since heard that by using the .shtml command I could do away with this code on every page and just include the mainmenu.shtml file instead.
My host does accept .shtml files so I am ok to use them.

Now the problem lies when trying to find exactly what to type and how to save my menu file.

I have cut and pasted my old menu code from my index file into a new notepad page and named it mainmenu.shtml (is this correct)?

Then I have inserted this command on my index page where my menu code used to be, <!--#include virtual="/mainmenu.shtml" -->

Should I now save my index as a .shtml file? Should I rename all the other files in my pages from .html to .shtml?

Any advice would be welcome as I am pulling my hair out here.

Cheers.

By the way the website is www.freebidz.co.uk, I know the layout is a mess but as I am learning I will get there in the end.
Corey Bryant
Site Admin


Joined: 15 May 2004
Posts: 8267
Location: Castle Rock CO USA

PostPosted: Fri Jun 01, 2007 8:19 am     Reply with quote



Included Content should help you out.

You should be able to name you file mainmenu.html - it does not need to be named shtml (I don't recommend it to be named shtml because that will be parsed as well). Sometimes some hosting companies require you to use .inc or .txt files for file includes instead.

The only file name that needs to have the shtml extension would be the one that contains the code
Code:
<!--#include virtual="/mainmenu.shtml" -->

_________________
Corey
Toll Free Fax Numbers | Merchant Accounts
ANNIHILATOR1



Joined: 01 Jun 2007
Posts: 3

PostPosted: Sat Jun 02, 2007 3:57 am     Reply with quote

Thanks for replying.

I have tried again but still no joy. I have tried using both file incude and virtual include. Not sure what the difference is but neither are working as yet.

I get my main content to work but at the top of the screen it has <--#include file="/mainmenu.html" -->

My index file is the one with the code in so I renamed that index.shtml, here is a portion of my code to show you what I have done.

<table width="1000">

<!--Main Menu insert-->
<!--#include file="/mainmenu.html" -->


<!-- Main Body -->
<td width="800" valign="top" bgcolor="#000CCC" align="center"><align="left"><img src="http://www.freebidz.co.uk/images/carling.jpg"><img src="http://www.freebidz.co.uk/freebidz/images/CLUB HEADER.jpg ">
<align="right"><img src="http://www.freebidz.co.uk/images/carling.jpg">
<br>The best watering hole in town!
<BR><font color=yellow>The best entertainment in town!
<br><font color=orange>The best place to socialise - FULL STOP!

Am I doing this all wrong?
Corey Bryant
Site Admin


Joined: 15 May 2004
Posts: 8267
Location: Castle Rock CO USA

PostPosted: Sat Jun 02, 2007 4:41 am     Reply with quote

If you use
Code:
/mainmenu.html
this is a virtual link and you need to use the virtual include. So
Code:
<!--#include file="/mainmenu.html" -->
should be
Code:
<!--#include virtual="/mainmenu.html" -->
or
Code:
<!--#include file="mainmenu.html" -->
Assuming the mainmenu.html is in the same folder as index.shtml

Also remember - some hosting companies might require you to have include files as inc or txt instead of HTML. You might want to also write up a support ticket as well to confirm

_________________
Corey
Toll Free Fax Numbers | Merchant Accounts | Microsoft Expressions
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> SSI All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
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
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial