Docs: Custom head

The head tag has dynamically generated content such as title, and links to the css and javascript files.

There are two was you can insert additional head content:

  1. using the Custom head field in your admin template.
  2. inserting into your top.inc file using the $_PAGE['custom_head'] var

The $_PAGE['custom_head'] var in top.inc

If the custom head you want to insert may differ from page to page, you can insert it into the top.inc file.

For example, you may have a javascript file that validates your newsletter signup form to be included only if the visitor is logged in:

<?
if($_SESSION['user_id']) {
       $_PAGE['custom_head']="<script type=\"text/javascript\" src=\"/template/newsletter_form_validate.js\"></script>";
}
?>

 
 

Revisions history (6)    ( hide | show )     Extensions > Custom head