Is there a way to insert a file of code to be executed  into a Dreamweaver file of code?

Posted on 2009-04-30
Last Modified: 2012-05-06
The idea I have is to make the code of my navigation bar - coded by me, not a Dreamweaver navigation bar - a file that I can just insert - the way one inserts an image - into each page of my site. Can one do this in Dreamweaver, and if so, how?
Current code for navigation bar - can I just somehow insert the filename into the place I want it in each Web page?

<div id="sidenav"><img src="../../template/template_images/vert_nav_bar.gif" title="Vertical Navigation Bar to Earring Pages according to color" name="vert_nav_bar" border="0" usemap="#vert_nav_barMap" id="vert_nav_bar" longdesc="template_images/vert_nav_bar.gif" />

<map name="vert_nav_barMap" id="vert_nav_barMap"><area shape="rect" coords="4,4,147,41" href="../red_earrings/red_earrings_p1.html" title="Red Earrings Page" />

<area shape="rect" coords="0,43,147,86" href="../orange_earrings/orange_earrings.html" title="Orange Earrings Page" />

<area shape="rect" coords="2,87,148,131" href="../yellow_earrings/yellow_earrings_p1.html" title="Yellow Earrings Page" />

<area shape="rect" coords="2,129,148,171" href="../green_earrings/green_earrings.html" title="Green Earrings Page" />

<area shape="rect" coords="1,171,146,215" href="../blue_earrings/blue_earrings_p1.html" title="Blue Earrings Page" />

<area shape="rect" coords="-1,214,151,256" href="../purple_earrings/purple_earrings_p1.html" title="Purple Earrings Page" />

<area shape="rect" coords="2,256,148,300" href="../pink_earrings/pink_earrings_p1.html" title="Pink Earrings Page" />

<area shape="rect" coords="-1,300,148,345" href="../../../homework_home_page/web_design_homework/wd_assignment8/earrings_pages/brown_earrings/brown_earrings.html" title="Brown Earrings Page" />

	<area shape="rect" coords="1,346,150,390" href=			          		                     		"black_earrings.html" title="Black Earrings Page" />


    <!--div tsg for sidenav 1200x200-->


Open in new window

Question by:franimaldoc
    LVL 5

    Accepted Solution

    By using the Server Side Includes in the insert tab in Dreamweaver.
    Make a new file containing only your navigation bar div (no head tags) then load it onto your server.
    Go back to the page you need your navigation bar inserting and use the server side include function to insert the nav where ever you need to insert it. As long as your nav file is loaded onto your server the navigation bar will be in the right place. You can insert the nav into as many pages you need.

    Author Closing Comment

    Neil, you are awesome!
     Thank you very much,

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Suggested Solutions

    I still run into .cgi files every now and then. In some instances, I actually prefer the simplicity of a .cgi script to other options. Since I use DreamWeaver extensively, what I needed was a way to open .cgi scripts in Dreamweaver. And I wanted to …
    This article is very specific and is only intended to help if you are installing Dreamweaver 8 in a Windows 7 environment with Office 2007 installed.   I'm not sure why Microsoft tends to release OS' that should not be released but they do.  Windows…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now