Docs: Custom head
Show AllHide All
-
Main Page
- About
-
About
- Development
-
Code Library
Databases
- Extensions
-
Examples
Snippets
Redirects
Custom head
Introduction
- Templates
-
Skins
Smart Tags
Body Tag Classes
Master Template
- Variables
-
Language
Session Variables
Page Variables
add page
Last update: Databases
by Sean on Tuesday 12th of July
at 04:05pm
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:
- using the Custom head field in your admin template.
- 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
×