add to cart divaPOPgold How-To use it with Include Files

There are powerful reasons to put divaPOPgold code into Include files if your server will allow it.

By placing divaPOPgold code in a single file and then Including that file in the head of each of your pages, you will be adding divaPOPgold 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:

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 divaPOPgold to all your pages?

Open one page and add divaPOPgold to it. Then in Dreamweaver open Code View to copy and delete the following code from the HEAD of the page.

  1. <script type="text/javascript">
  2. <!--
  3. var gDivaPOPgold="pdf,outlink";
  4. //-->
  5. </script>
  6. <script type="text/javascript" src="/diva/divaCommon.js"></script>
  7. <script type="text/javascript" src="/diva/divaPOP/divaPOPgold.js"></script>
  8. <link href="/diva/divaPOP/divaPOPgold.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.)

Then in the same spot from which you removed the code add the appropriate Include command.

ASP, .NET and Apache with SSI
  1. <!--#include virtual="/headscripts.inc" -->
ColdFusion
  1. <cfinclude template="/headscripts.inc">
JSP
  1. <%@ include file="/headscripts.inc" %>
PHP
  1. <?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.