POP How-To use it with Include Files
There are powerful reasons to put divaPOP code into Include files if your server will allow it.
By placing divaPOP code in a single file and then Including that file in the head of each of your pages, you will be adding divaPOP to all your pages at once!
Next, can you do this? Well, if you are on a host that supports ASP, PHP, CF, or SSI, then you can do this. It might require a change in the file extension on all your pages though.
Read our article about Server-Side Includes & more to learn more about this subject. Additionally, you can visit these pages:
- http://www.freewebmasterhelp.com/tutorials/ssi
- http://www.4guysfromrolla.com/webtech/080199-1.shtml
- http://livedocs.macromedia.com/.../Using_Dreamweaver...
- http://httpd.apache.org/docs/2.0/howto/ssi.html
If you are new to this, do not be put off by its apparent complexity. Once you get the idea, it is very, very easy and incredibly powerful.
So, what do you put in the Include file to add divaPOP to all your pages?
Open one page and add divaPOP to it. Then (in Dreamweaver open Code View) copy and delete the following code from the HEAD of the page.
<script type="text/javascript"><!--var gDivaPOP="pdf,outlink";//--></script><script type="text/javascript" src="/diva/divaCommon.js"></script><script type="text/javascript" src="/diva/divaPOP/divaPOP.js"></script><link href="/diva/divaPOP/divaPOP.css" rel="stylesheet" type="text/css">
Simply place the code, intact, into a new blank file (or into an existing Include file that is already used in the HEAD of your documents). There must be no HEAD, TITLE, BODY tags etc on this page. Save it as, for example "headscripts.inc" (or others, see our article or Links above for more on this.)
You can learn how to edit the parameters in line 3, should you ever need to alter them manually, by reading a bit of the Standalone how-to page.
Then in the same spot from which you removed the code add the appropriate Include command.
- ASP, .NET and Apache with SSI
-
<!--#include virtual="/headscripts.inc" -->
- ColdFusion
-
<cfinclude template="/headscripts.inc">
- JSP
-
<%@ include file="/headscripts.inc" %>
- PHP
-
<?php include('/headscripts.inc'); ?>
We have not dealt here with path and other issues. Learn more about all this at the links provided.
Congratulations! You are building your website in a very efficient and flexible way.
Unobtrusive Scripts and Dreamweaver Extensions