Skip navigation
Handywally
Currently Being Moderated

Dreamweaver menu

Dec 5, 2013 3:02 AM

Hi, I am new to Dreamweaver. I will try to be brief but still get my question over. I have a template for every web page i create. This has one menu for all pages. All the sub menus will have another menu for each section, and within those sections will have another set of menues, all relevant to that section. (hope it is not too confusing) I have basically created a div tag with menu links. I am looking for a way to create a menu for one set of pages, and when i add another page to be able to link maybe to an external sheet which would have all the page links in it? something like css style sheets?

 
Replies
  • Currently Being Moderated
    Dec 5, 2013 11:17 AM   in reply to Handywally

    You're looking at Server Side Includes. There are various ways of setting them up... it all depends on your hosting server... and a few other (minor) factors. Suggest you do a search for 'server side includes'. That'll point you to various options and alternatives.

     

    Just to explain a bit and this relates to sites hosted on an Apache server:

     

    1a. I don'tlike the .shtml extension (sometimes) required, so all my files are .html

    1b. I, therefore, have this content in a file called .htaccess (please note, the file name is .htaccess - there is nothing, no name, in frant of the 'dot'. The file is in the root of the site (where your index.html file is located, and its contents are as follows:

     

    Options +Includes

    AddType text/html .html

    AddHandler server-parsed .html

     

    2a. I have all my server side include files in a common directory, with an individual file for each include that I need. The link to this is, for example, as follows:

    <div id="mainMenu"> <!--#include virtual="_assets/_includes/mainmenu_index.ssi" --></div>

     

    This, obviously, points to the SSI file for my main menu. Please note, the path is important

     

    This one points to the footer content:

    <div id="footer" class="footer">

        <!--#include virtual="_assets/_includes/footer-index.ssi" -->

        </div>

     

    You can have as many SSIs on a page as you require... Just remember that if you need the same content to be duplicated, then you use the same ssi link in that place / position.

     

    3a. Your SSI file must be clean. just pure text. Like this, for my footer:

     

    <p><a href="../index.html">HOME</a> | <a href="../services/services.html">SERVICES</a> | <a href="../support/support.html">SUPPORT</a> |  <a href="../company/aboutus.html">COMPANY</a> | <a href="../contact/contact.html">CONTACT</a></p>

     

    There must be no document declarations or anything else....

     

    Hope this helps...

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 5, 2013 3:46 PM   in reply to Handywally

    If you're on an Apache / Linux server, use PHP includes for your menus.

     

    • Basically, put each list menu inside it's own text file. 
    • SaveAs some_filename.ssi. 
    • Do not add  a doc type or any other HTML tags that are not used by your menu. What you're going for is a plain list menu and nothing else.

     

    Inside your parent pages, replace your menu code with a PHP include statement.

     

    <?php require_once('path/some_filename.ssi'); ?>

     

    Repeat with other menus and pages.

     

    Save parent pages (those containing the include statements) with a .php extension.

     

     

    Nancy O.

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 6, 2013 5:18 AM   in reply to shunithD
     
    |
    Mark as:
  • Currently Being Moderated
    Dec 6, 2013 6:44 AM   in reply to Handywally

    Just put that bit in the exisiting .htaccess file. I don't think there should be any problem.

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 6, 2013 10:53 AM   in reply to Handywally

    To clarify a few points:

     

    1) A server-side include file can be named anything you wish:

              some_filename.ssi,

              some_filename.html,

              some_filename.foo 

    It doesn't matter what you call the include files.

     

    2) Parent pages (the ones containing the include statement) need to parse data on the server.  In order for your remote server to parse data,  you must save parent pages with a file extension your server recognizes.  For example, most Linux servers recognize .php or .shtml files.  If unsure, check with your hosting provider.

     

    3) Unless you have a local testing server installed on your computer, you won't see parsed data when you do a local preview in browsers.  You'll need to upload your pages to your remote server to test.

     

     

    Nancy O.

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 7, 2013 7:40 AM   in reply to Nancy O.

    Nancy O. wrote:

    3) Unless you have a local testing server installed on your computer, you won't see parsed data when you do a local preview in browsers.  You'll need to upload your pages to your remote server to test.

    You will see the parsed data if you do a preview through DW. But only for that page. Clicking on links will not show the parsed data in the linked page.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points