logo-dw

Go Back   Dreamweaver Club Forums > Dreamweaver forums > Spry
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 07-12-2011, 04:52 PM   #1
wortmann
 
Join Date: Jul 2011
Posts: 10
Unhappy vertical menu bar with SSI

I'm new to all of this. But i've started to design a menu bar (vertical). I've decided to make one (template) vertical menu using spry assets so i can use them in all my pages and even in multiple websites.

However i cant get the hang off the SSI.
I've created a HTML index page (just for practice). Here is the code:

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Spry menu</title>
<!--#include virtual="/includes/menu.html" -->
<script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
<link href="SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" />
</head>

Then i've created a menu.html page and this one is located in the root/include folder and it contains the following:


<head>
<script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
<link href="SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" />

</head>
<body>
<ul id="MenuBar1" class="MenuBarVertical">
<li><a class="MenuBarItemSubmenu" href="#">Item 1</a>
<ul>
<li><a href="#">Item 1.1</a></li>
<li><a href="#">Item 1.2</a></li>
<li><a href="#">Item 1.3</a></li>
</ul>
</li>
<li><a href="#">Item 2</a></li>
<li><a class="MenuBarItemSubmenu" href="#">Item 3</a>
<ul>
<li><a class="MenuBarItemSubmenu" href="#">Item 3.1</a>
<ul>
<li><a href="#">Item 3.1.1</a></li>
<li><a href="#">Item 3.1.2</a></li>
</ul>
</li>
<li><a href="#">Item 3.2</a></li>
<li><a href="#">Item 3.3</a></li>
</ul>
</li>
<li><a href="#">Item 4</a></li>
</ul>
<script type="text/javascript">
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
</script>
</body>


I can see the menu in the design window of dreamweaver but when i go to live view it's not there. or if i want to see the result in IE it redirects to the include/menu.html and it comes up with internet explorer can't open the page.

is there anyone out there that could help?
wortmann is offline   Reply With Quote
Old 07-12-2011, 05:45 PM   #2
gentleone
gentleone's Avatar
 
Join Date: Nov 2009
Location: Rhodes, Greece
Posts: 2,837
Default

a few things:
  1. in order to make use of PHP includes you need to save your index page as index.php and most importantly your web server must have PHP installed on it.
  2. if that's okay, you should include your menu (which if I were you I would also save as menu.php) not in between the head tags but in between the body tags.
  3. last thing... your include should look something like this:
    PHP Code:
    <?php include('includes/menu.php'); ?>
__________________
www.gentlemedia.nl
gentleone is offline   Reply With Quote
Old 07-12-2011, 09:59 PM   #3
wortmann
 
Join Date: Jul 2011
Posts: 10
Default

Hello,

I've done what you said.
My webserver has php installed. I'm only testing this out on my local PC.
I'm creating the website using DW cs5.

however i still have the same problem.

Just to make sure i did everything right:
I've copied the include (<?php include('includes/menu.php'); ?> ) within the body tag.
I've save the index.html file as a .php file, and have done the same with the menu.html.

in dreamweaver i do het the warning: An unknown error occurred while discovering dynamic-related files.
wortmann is offline   Reply With Quote
Old 07-13-2011, 10:37 AM   #4
gentleone
gentleone's Avatar
 
Join Date: Nov 2009
Location: Rhodes, Greece
Posts: 2,837
Default

If you want to test PHP files locally, then you need to have a server (Apache) installed locally as well. PHP is a server side language, so no server, no PHP.

Another thing what I didn't see before is that your include menu.php contains head and body tags, and you also include the javascript files again.
Your menu.php file should only contain this:
HTML Code:
<ul id="MenuBar1" class="MenuBarVertical">
  <li><a class="MenuBarItemSubmenu" href="#">Item 1</a>
    <ul>
      <li><a href="#">Item 1.1</a></li>
      <li><a href="#">Item 1.2</a></li>
      <li><a href="#">Item 1.3</a></li>
    </ul>
  </li>
  <li><a href="#">Item 2</a></li>
  <li><a class="MenuBarItemSubmenu" href="#">Item 3</a>
    <ul>
      <li><a class="MenuBarItemSubmenu" href="#">Item 3.1</a>
        <ul>
          <li><a href="#">Item 3.1.1</a></li>
          <li><a href="#">Item 3.1.2</a></li>
        </ul>
      </li>
      <li><a href="#">Item 3.2</a></li>
      <li><a href="#">Item 3.3</a></li>
    </ul>
  </li>
  <li><a href="#">Item 4</a></li>
</ul>
<script type="text/javascript">
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
</script>
__________________
www.gentlemedia.nl
gentleone is offline   Reply With Quote
Old 07-13-2011, 02:08 PM   #5
wortmann
 
Join Date: Jul 2011
Posts: 10
Default

i've got apache and sql server running. i did make the mistake of the body tag. will have a look
wortmann is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:03 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com