Help with CSS Menu Designer and SSI -...

User 563328 Photo


Registered User
85 posts

Hello Everybody,

I have already created my vertical menu in CSS Menu Designer and would now like to try using a Server Side Include. After reading through all of the threads I have a couple of questions and would like a kind soul to verify that I understand the process before continuing.

According to my web host the SSI path is <!--#include virtual="anyfilehere" --> and the web pages need to be named either .shtml or .sht rather than .html or .htm.

So the first thing I need to do is obviously rename those pages, including index.html - correct?

I leave all of the files that CSS Menu Designer created such as the .mnu file and the .css files where they currently reside - correct?

I want to have 2 includes - one for the menu and one for the footer. Starting with the menu include, I open a blank page and name it using the .html and not the .shtml extension. Since I already have the menu inserted onto each page, can I just open any page and copy and paste the menu items between the <body> </body> tags of the new file or do I have to re-create it in the CSS Menu Designer? Once that is pasted, I also would copy and paste the <link rel="stylesheet" type="text/css" href="css/menu-menu.css" media="screen" /> tag in the <head> </head> tags - correct?

For the include file do I need to have all of the other data such as meta data, doctype, etc. between the HEAD tags as well?

To then utilize the SSI, in the example below, I would first delete the existing <link rel="stylesheet".../> from the head tags, delete the menu list items from where they currently appear in the page and then insert the <!--#include virtual file="anyfilehere.html" --> file - correct?

Because I was having difficulty getting the menu to center I created a <division class="center"> with the <ul class="menu-menu"> so should the include look like this:

<division class="center>
<ul class="menu-menu">
<!--#include virtual file="anyfilehere.html" -->
</ul>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Frank and Kolb, Russia - Welcome</title>
<meta http-equiv="generator" content="CoffeeCup HTML Editor (www.coffeecup.com)" />
<meta name="created" content="Sun, 06 Jun 2010 18:48:12 GMT" />
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<meta name="description" content="Welcome to the joint website for the ancestral villages of Frank and Kolb, neighboring villages located along the Volga River in Saratov, Russia." />
<meta name="keywords" content="Frank, Kolb, Saratov, Russia, German, Russian, ancestral, villages, colonies, River, Volga, genealogy" />

<link rel="shortcut icon" href="http://www.frank-kolb-russia.org/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" type="text/css" media="screen" href="css/main-styles.css" />
<link rel="stylesheet" type="text/css" media="print" href="css/print.css" />
<link rel="stylesheet" type="text/css" href="css/menu-menu.css" media="screen" />

</head>
<body>

<div id="container"><a name="top"></a>
<div id="wrapper">

<div id="header">
<h1>Frank and Kolb, Russia</h1>
<p class="description">Two German colonies on the Volga River</p>
</div>

<div class="center">
<ul class="menu-menu">
<li class="first"><a href="index.html">Home</a>
<ul>
<li class="first"><a href="index.html">Welcome</a></li>
<li><a href="history/history.html">History</a>
</ul>

Since I didn't use CSS Menu Designer to create the footer and it is currently using the main-styles.css file, would I just copy the <link rel="stylesheet" type...css/main-styles.css" /> into the footer include file, and leaving it on each individual page as well?

And finally - when it says "you want to make sure that all files associated with the include is in the same file folder", does this mean that I have to have copies of each of the Menu.html and Footer.html files in each sub folder, i.e. History, Resources, Miscellaneous etc.?

No question is a dumb question right? :rolleyes:

Kelly

User 38401 Photo


Senior Advisor
10,951 posts


So the first thing I need to do is obviously rename those pages, including index.html - correct?


Correct.
Don't forget to also redo all the links you have to those pages within your site pages, Including your new CSS menu, footer links etc.


I leave all of the files that CSS Menu Designer created such as the .mnu file and the .css files where they currently reside - correct?


Correct.
The files that the menu program created just stay where they are.

I want to have 2 includes - one for the menu and one for the footer. Starting with the menu include, I open a blank page and name it using the .html and not the .shtml extension.


I named my the .shtml extention for my menu, I am not sure it really matters though, try it either way.

Since I already have the menu inserted onto each page, can I just open any page and copy and paste the menu items between the <body> </body> tags of the new file or do I have to re-create it in the CSS Menu Designer? Once that is pasted, I also would copy and paste the <link rel="stylesheet" type="text/css" href="css/menu-menu.css" media="screen" /> tag in the <head> </head> tags - correct?


You would insert the
<!--#include virtual file="anyfilehere.html" -->
wherever you removed the code for the menu. I would always suggest that you remove "all" the code for the menu section so you don't get confused later and for easier pasting of the menu ssi code. Include comment tags even to help you know where it is supposed to be or where it is etc.

For the include file do I need to have all of the other data such as meta data, doctype, etc. between the HEAD tags as well?


No, you don't need anything really other than the code for the item you are replacing. I am not sure if you "can" add all that stuff or not, but I do know you don't need it for it to work. I am thinking there may be a better way than not having that though so once again try both ways to see what works best for you.

To then utilize the SSI, in the example below, I would first delete the existing <link rel="stylesheet".../> from the head tags, delete the menu list items from where they currently appear in the page and then insert the <!--#include virtual file="anyfilehere.html" --> file - correct?


Once again, the only code you need to remove is the menu code itself to a separate page. You don't need to change anything in the Head at all. Just be sure that all new pages include that Head info that the menu requires and you're fine. You don't need to "alter" this info in the future which is why it's not necessary to pull it out or replace it in the Headtags

Because I was having difficulty getting the menu to center I created a <division class="center"> with the <ul class="menu-menu"> so should the include look like this:

<division class="center>
<ul class="menu-menu">
<!--#include virtual file="anyfilehere.html" -->
</ul>


You should be able to do it as above, but you would be more accurate to do it like this and include the
<ul class="menu-menu">
<!--#include virtual file="anyfilehere.html" -->
</ul>

into the include page itself. Remove all code for the menu to the include page, that keeps it easy then do something like this:

<!-- Start CSS Menu -->
<div class="center>
<!--#include virtual file="anyfilehere.html" -->
</div>
<!-- End CSS Menu -->


So it will end up like this in the menu section of the below code and all menu code is in it's own little page. This goes exactly the same thing for the footer area too. Hope this all helps :)


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Frank and Kolb, Russia - Welcome</title>
<meta http-equiv="generator" content="CoffeeCup HTML Editor (www.coffeecup.com)" />
<meta name="created" content="Sun, 06 Jun 2010 18:48:12 GMT" />
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<meta name="description" content="Welcome to the joint website for the ancestral villages of Frank and Kolb, neighboring villages located along the Volga River in Saratov, Russia." />
<meta name="keywords" content="Frank, Kolb, Saratov, Russia, German, Russian, ancestral, villages, colonies, River, Volga, genealogy" />

<link rel="shortcut icon" href="http://www.frank-kolb-russia.org/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" type="text/css" media="screen" href="css/main-styles.css" />
<link rel="stylesheet" type="text/css" media="print" href="css/print.css" />
<link rel="stylesheet" type="text/css" href="css/menu-menu.css" media="screen" />

</head>
<body>

<div id="container"><a name="top"></a>
<div id="wrapper">

<div id="header">
<h1>Frank and Kolb, Russia</h1>
<p class="description">Two German colonies on the Volga River</p>
</div>

<!-- Start CSS Menu -->
<div class="center>
<!--#include virtual file="anyfilehere.html" -->
</div>
<!-- End CSS Menu -->


Since I didn't use CSS Menu Designer to create the footer and it is currently using the main-styles.css file, would I just copy the <link rel="stylesheet" type...css/main-styles.css" /> into the footer include file, and leaving it on each individual page as well?


You don't need to copy any of the css style links from the head to their respective include pages because it's going to read them when they are put back into the page using the include. Basically you are just pulling out the code itself and no need for much else. There are a few exceptions to this mind you, so it does depend on your site itself and how you have it setup. Once again try without moving it at all and see if it works, if not then include it in the include pages at the top. No need for Head tags for this either.

And finally - when it says "you want to make sure that all files associated with the include is in the same file folder", does this mean that I have to have copies of each of the Menu.html and Footer.html files in each sub folder, i.e. History, Resources, Miscellaneous etc.?


I'm not quite sure I follow completely here what it's saying, but I keep all my include files right in my main site's root directory with the rest of the .shtml pages. To be honest it really doesn't matter as long as you put the correct pathway into the include code:

<!--#include virtual file="folder/folder/anyfilehere.html" -->

No question is a dumb question right? :rolleyes:


Hahaha no worries, someone else will hopefully chime in and correct me if I'm wrong on any of this since I'm basically telling you how "I've" done it, doesn't mean it's the perfectly right way so who knows, maybe I'll learn something too :)
User 563328 Photo


Registered User
85 posts

Jo Ann,


You should be able to do it as above, but you would be more accurate to do it like this and include the
<ul class="menu-menu">
<!--#include virtual file="anyfilehere.html" -->
</ul>

into the include page itself. Remove all code for the menu to the include page, that keeps it easy then do something like this:

<!-- Start CSS Menu -->
<div class="center>
<!--#include virtual file="anyfilehere.html" -->
</div>
<!-- End CSS Menu -->


I just need one more clarification - on the include page you suggested adding the following to the include page:

<ul class="menu-menu">
<!--#include virtual file="anyfilehere.html" -->
</ul>

So would the include page look like this?

<body>

<ul class="menu-menu">
<!--#include virtual file="anyfilehere.html" -->
</ul>

<ul class="menu-menu">
<li class="first"><a href="index.html">Home</a>
<ul>
<li class="first"><a href="index.html">Welcome</a></li>
<li><a href="history/history.html">History</a>
<ul>
<li class="first"><a href="history/history.html">History</a></li>
<li><a href="history/catherine's-manifesto.html">Catherine's Manifesto</a></li>
<li><a href="history/chronology.html">Chronology of German-Russian History</a></li>
<li><a href="history/seven-years-war.html">Seven Years' War</a></li>
</ul>
</li>
<li><a href="miscellaneous/miscellaneous.html">Miscellaneous</a>
<ul>
<li class="first"><a href="miscellaneous/miscellaneous.html">Cookbooks/Recipes</a></li>
<li><a href="miscellaneous/dictionary-food-terms.html">Dictionary of German-Russian Food Terms</a></li>
<li><a href="miscellaneous/handwriting-guide.html">German Handwriting Guides</a></li>
<li><a href="miscellaneous/reading-list.html">Reading List</a></li>
</ul>

</body>

Or am I getting it completely wrong?

Kelly

User 563328 Photo


Registered User
85 posts

Sorry, one more question.

I have 7 html files in the root folder and all of the rest of my pages are in subfolders.

For the 7 files in the root folder, the paths for the navigation look like this:

<ul class="menu-menu">
<li class="first"><a href="index.html">Home</a>
<ul>
<li class="first"><a href="index.html">Welcome</a></li>
<li><a href="history/history.html">History</a>
<ul>
<li class="first"><a href="history/history.html">History</a></li>
<li><a href="history/catherine's-manifesto.html">Catherine's Manifesto</a></li>
<li><a href="history/chronology.html">Chronology of German-Russian History</a></li>
<li><a href="history/seven-years-war.html">Seven Years' War</a></li>
</ul>
</li>
<li><a href="miscellaneous/miscellaneous.html">Miscellaneous</a>
<ul>
<li class="first"><a href="miscellaneous/miscellaneous.html">Cookbooks/Recipes</a></li>
<li><a href="miscellaneous/dictionary-food-terms.html">Dictionary of German-Russian Food Terms</a></li>
<li><a href="miscellaneous/handwriting-guide.html">German Handwriting Guides</a></li>
<li><a href="miscellaneous/reading-list.html">Reading List</a></li>
</ul>

However for the pages that reside in the sub folders the paths are as follows with the leading ../ :

<ul class="menu-menu">
<li class="first"><a href="../index.html">Home</a>
<ul>
<li class="first"><a href="../index.html">Welcome</a></li>
<li><a href="../history/history.html">History</a>
<ul>
<li class="first"><a href="../history/history.html">History</a></li>
<li><a href="../history/catherine's-manifesto.html">Catherine's Manifesto</a></li>
<li><a href="../history/chronology.html">Chronology of German-Russian History</a></li>
<li><a href="../history/seven-years-war.html">Seven Years' War</a></li>
</ul>
</li>
<li><a href="../miscellaneous/miscellaneous.html">Miscellaneous</a>
<ul>
<li class="first"><a href="../miscellaneous/miscellaneous.html">Cookbooks/Recipes</a></li>
<li><a href="../miscellaneous/dictionary-food-terms.html">Dictionary of German-Russian Food Terms</a></li>
<li><a href="../miscellaneous/handwriting-guide.html">German Handwriting Guides</a></li>
<li><a href="../miscellaneous/reading-list.html">Reading List</a></li>
</ul>

Does this mean that I need two different menu include files and two different footer include files due to the different navigation paths?

Kelly
User 563328 Photo


Registered User
85 posts

Woo Hoo, it works!

Thanks to Jo Ann for all of her suggestions.

For those that are interested - I did in fact create two separate includes due to the different navigation paths for both the menu and the footer.

I also added the include statement(s) on the inlcude page(s). My menu include page for the root files looks like this -

<body>

<ul class="menu-menu">
<!--#include virtual file="anyfilehere.html" -->
</ul>

<ul class="menu-menu">
<li class="first"><a href="index.html">Home</a>
<ul>
<li class="first"><a href="index.html">Welcome</a></li>
<li><a href="history/history.html">History</a>
<ul>
<li class="first"><a href="history/history.html">History</a></li>
<li><a href="history/catherine's-manifesto.html">Catherine's Manifesto</a></li>
<li><a href="history/chronology.html">Chronology of German-Russian History</a></li>
<li><a href="history/seven-years-war.html">Seven Years' War</a></li>
</ul>

Kelly
User 38401 Photo


Senior Advisor
10,951 posts

Glad you got it working kelly!! Good job and have fun with the rest of it :)

http://wolverana.com/myimages/woohoo.gif
User 563328 Photo


Registered User
85 posts

Thanks Jo Ann, you rock!

Just for clarification (for all of you eagle-eyed folks out there) I did in fact change all of the links above from .htlm to .shtml before adding to the include page. :P
User 38401 Photo


Senior Advisor
10,951 posts

yep that's the problem I'm having right now with my main site for a business that hosts websites and such. I created this SSI system on there and now "EVERY" site that I load onto that same domain in any sub directory has to be like that too lol. I think I'll have to take it off there once I have it all done. Good thing I don't have to add a lot of sites to that particular domain hehe.

Just keep in mind that anything you add in the future to the main directory or any sub directory, including even separate sites that you might add to a sub directory in that domain will need to be using the .shtml extension. You don't have to do anything else to it other than that so if there's no need for the SSI on any other sites in the domain then just add the .shtml extension to them and it will all be fine.

I found out the hard way that you cannot put .html on any extensions anywhere in that domain once you use SSI in it (unless you remove the SSI of course) as it will always try to download something lol. It's a good way to be sure you got it right and don't forget though lol, as long as you always check your site pages online once you upload them you can't forget it as it won't work if you do lol.

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.