Sets the content of the title element, and h1 page header.
$TITLE = 'My page title';
Special variables that allow content to automatically be configured for a section of the website.
-
false
Omit content.
-
true
Result of including FILE with string buffering. Each variable uses a different FILE, listed below.
-
String
html markup as a string.
FILE is _head.inc.php
Markup before the closing head element of a page ($HEAD</head>
). Typically stylesheets.
$HEAD = '<link rel="stylesheet" href="mystyles.css"/>' .
'<link rel="stylesheet" href="mystyles2.css"/>';
FILE is _foot.inc.php
Markup before the closing body element of a page ($FOOT</body>
). Typically javascript.
$FOOT = '<script src="myscript.js"></script>' .
'<script src="myscript2.js"></script>';
FILE is _navigation.inc.php
Markup for "section" navigation.
Appears before "site" navigation ($SITE_SITENAV
) in sidebar/offcanvas.
$NAVIGATION = navItem('/section/', 'Section') .
navGroup('Section 2',
navItem('/section2/index.php', 'Section 2 page') .
navItem('/section2/other.php', 'Section 2 other'));
By setting $NAVIGATION to true, all pages in a section can share the same navigation file without repeating the navigation content in each page.
- In the template configuration for a content page, set $NAVIGATION to true:
<?php
if (!isset($TEMPLATE)) {
$TITLE = 'My title';
$NAVIGATION = true;
include 'template.inc.php';
}
?>
content
- In the same directory, or a parent directory, create a file named
_navigation.inc.php
that outputs navigation:
<?php
echo navItem('/test.php', 'Test') .
navGroup('Group 1',
navItem('/item1.php', 'Group item 1') .
navItem('/item2.php', 'Group item 2')) .
navItem('/item.php', 'Item') .
navGroup('Group 2',
navItem('/group2/item1.php', 'Group item 1') .
navItem('/group2/item2.php', 'Group item 2'));
?>
This generates a navigation list similar to:
- "Test" shows the styles of the "current page".
- "Item" shows the styles when mouse hovers over the item.
- Group items are indented under an un-linked group title.
Cache age for page in seconds.
Default is -1
seconds.
Values less than zero mean do not send headers.
Used by cache.inc.php
to send Cache-Control
and Expires
HTTP headers.
NOTE: you must include cache.inc.php
for this variable to be used.
Set cache scope for page.
Default is public
.
Only used in combination with non-negative $CACHE_MAXAGE values.
NOTE: you must include cache.inc.php
for this variable to be used.
Sets the page contact information email.
$CONTACT = 'lisa@usgs.gov';
Sets the page contact url. The placeholder {CONTACT}
is replaced with the contents of the $CONTACT variable.
$CONTACT_URL = '/contactus/?to={CONTACT}';
Cooperator logo(s).
$COOPERATORS =
'<a class="cooperator" href="http://anss.org/">' .
'<img src="/theme/images/anss-logo.svg"' .
' alt="in cooperation with Advanced National Seismic System (ANSS)"/>' .
'</a>';
$COOPERATORS =
'<img class="cooperator" src="/theme/images/anss-logo.svg"' .
' alt="in cooperation with Advanced National Seismic System (ANSS)"/>';
Page language. Default is en
.
$LANG = 'en';
When page was last modified. Default is filemtime($_SERVER['SCRIPT_FILENAME'])
.
$MODIFIED = filemtime('somefile.txt');
NOTE: you must include cache.inc.php
for this variable to be used.
Configure sharing links in page footer.
Values:
- (default) {Boolean} false, don't include social links on page.
- {Array} social link templates.
Default value is
$SOCIAL = array(
array(
'name' => 'Facebook',
'url' => 'https://www.facebook.com/sharer.php?u={URL}',
'class' => 'facebook'
),
array(
'name' => 'Twitter',
'url' => 'https://twitter.com/share?url={URL}&text={TITLE}',
'class' => 'twitter'
),
array(
'name' => 'Google',
'url' => 'https://plusone.google.com/_/+1/confirm?url={URL}',
'class' => 'google-plus'
),
array(
'name' => 'Email',
'url' => 'mailto:?to=&subject={TITLE}&body={URL}',
'class' => 'email'
)
);
Url values may include "{TITLE}" and "{URL}", which are replaced with page specific values.
Configure the domain name, embedded in search form for search this site.
$SITE_URL = 'earthquake.usgs.gov';
Configure "site" navigation. Appears between "section" navigation ($NAVIGATION) and "search" in sidebar/offcanvas.
$SITE_SITENAV = navItem('/earthquakes/', 'Earthquakes') .
navItem('/hazards/', 'Hazards') .
navItem('/data/', 'Data') .
navItem('/learn/', 'Learn') .
navItem('/monitoring/', 'Monitoring') .
navItem('/research/', 'Research');
Configure "common navigation". Appears at bottom of page.
$SITE_COMMONNAV =
navItem('/index.php', 'Home') .
navItem('/aboutus/', 'About Us') .
navItem('/contactus/', 'Contact Us') .
navItem('/legal/', 'Legal') .
navItem('/partners/', 'Partners');