• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 211
  • Last Modified:

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

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

1 Solution
Neil_BradleyWeb UX/UI DeveloperCommented:
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.
franimaldocAuthor Commented:
Neil, you are awesome!
 Thank you very much,

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now