Overview
The LP6 base template sections consist of header.php and footer.php files. Each template section must be included on an LP6 page using the incTemplateSection function.
header.php
The header file contains all the commonHead includes in /core/_includes/ used to construct the page <head> tag:
head
- Robots: commonHead-robots.php
- Site Info/Meta: commonHead-siteInfo.php
- Extra Meta: commonHead-meta.php
- CSS: commonHead-lp6-css.php
- Icons: commonHead-icons.php
- JS: commonHead-lp6-js.php
The header file also echoes $GLOBALS["headExtras"] which can be defined in the page to store extra meta, css, js, etc. A Refresh Trigger method is also included which checks the URL for certain paramaters ("t" and "url") to create a meta refresh for basic redirects. The meta refresh can also be created manually in page by setting values for $GLOBALS["refreshTimer"] and $GLOBALS["refreshUrl"].
body
The header file also opens the <body> tag.
GTM
Our Google Tag Manager (GTM) code is included as the first body child. See, /core/_includes/gtm-live.php.
header and nav
The header file also contains the <header> and its child <nav> elements. These display the university logo, university phone number, and application CTA button.
Logo Scripts
The logos used on LP6 pages are in SVG and are responsive in and of themselves so that the text elements hide on mobile screens to prevent collision with other elements in the <nav>. For this responsive behavior to fully function, we include a function written in php and javascript to resize the SVG logo's viewBox.
<!-- svg logo resizer -->
<script>
$(window).load(function () {
var resp = document.getElementById("logo");
var respSvg = resp.querySelector("svg");
//resize container to fit img on load
if($(window).width() <= 500){
<?php
if ($GLOBALS["brand"] == "amu") {
echo 'respSvg.setAttribute("viewBox","0 0 310 336");';
}
else if ($GLOBALS["brand"] == "apu") {
echo 'respSvg.setAttribute("viewBox","0 0 150 170.67");';
}
?>
}
else {
<?php
if ($GLOBALS["brand"] == "amu") {
echo 'respSvg.setAttribute("viewBox","0 0 775 336");';
}
else if ($GLOBALS["brand"] == "apu") {
echo 'respSvg.setAttribute("viewBox","0 0 384 170.67");';
}
?>
}
})
$(document).ready(function() {
var resp = document.getElementById("logo");
var respSvg = resp.querySelector("svg");
//resize container to fit img on resize event
$(window).on('resize', function(){
if($(window).width() <= 500){
<?php
if ($GLOBALS["brand"] == "amu") {
echo 'respSvg.setAttribute("viewBox","0 0 310 336");';
}
else if ($GLOBALS["brand"] == "apu") {
echo 'respSvg.setAttribute("viewBox","0 0 150 170.67");';
}
?>
}
else {
<?php
if ($GLOBALS["brand"] == "amu") {
echo 'respSvg.setAttribute("viewBox","0 0 775 336");';
}
else if ($GLOBALS["brand"] == "apu") {
echo 'respSvg.setAttribute("viewBox","0 0 384 170.67");';
}
?>
}
});
});
</script>
main
Lastly, the header file opens the <main> tag which contains all LP6 sub-template content (see copycat or other template).
footer.php
The footer file contains the <footer> tag which also includes the content in /core/_includes/commonFoot.php. This includes:
- Accreditation statement
- Copyright
- Privacy policy
- Terms of use
- Disclosure
CSS Vars Ponyfill
The footer file also includes the ponyfill script for custom CSS properties in IE and other older browsers.
Facebook Tracker
Lastly, the footer file includes some kind of <noscript> Facebook tracking pixel whose provenance with which I'm unfamiliar.
LP5 Copycat Template
Currently this template is meant to approximate the look, feel, and experience of the existing LP5 pages. It follows the same basic structure and includes the same general content sections:
- RFI Overlay: _includes/rfi-overlay-lp6.php
- Degree Finder: _includes/degree-finder-v4.php
- Tuition (APU): _includes/affordability-lp6.php
- Tuition (AMU): _includes/tuition-svg-lp6.php
- Accreditation: _includes/accreditation-lp6.php
- Video: _includes/video-basic-lp6.php
- Student Spotlight: _includes/spotlight-{brand}-lp6.php
- Steps to Enroll: _includes/steps-to-enroll-lp6.php
Each include, excepting the degree finder, copied the existing LP5 include and reformated the html/layout for the LP6 system (-lp6 is appended to each filename to distinguish them from the old). Each include is also nested within a <section> tag to allow for custom background color, etc.
The template ends with a closing </main> tag.