Take a Tour (take_a_tour.php)
Overview
The take_a_tour.php script renders the public Take a Tour page for the Tech Logistics site. It assembles shared templates, injects metadata, initializes JavaScript for a video modal, and embeds a YouTube tour video in a FancyBox iframe .
Template & Configuration
- inc/config.php
Starts the session, defines constants (e.g.TEMPLATE_DIR), and resolves$current_template_namebased on$TEMPLATE[$currnt_file_name]. - Template Top Fragment
Optionally includesTEMPLATE_DIR . $current_template_name . "_top.php"if that file exists . - Metadata Includes
TEMPLATE_DIR . "inc/template_meta.php"for core meta tagsinc/panels/meta.phpfor shared<meta>or scripts- Conditionally includes
TEMPLATE_DIR . $current_template_name . "_meta.php"for page-specific metadata .
JavaScript Initialization
The page uses jQuery to bind FancyBox to elements with the .tour_video class:
$(document).ready(function(){
$(".tour_video").fancybox({
transitionIn: 'elastic',
transitionOut: 'elastic',
speedIn: 600,
speedOut: 200,
overlayShow: true,
type: 'iframe',
width: 818,
height: 618,
hideOnOverlayClick: false
});
});
This displays the YouTube tour in a modal iframe .
Page Structure
<?php
include_once("inc/config.php");
if (file_exists(TEMPLATE_DIR . $current_template_name . "_top.php")) {
include_once(TEMPLATE_DIR . $current_template_name . "_top.php");
}
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<?php
include_once(TEMPLATE_DIR . "inc/template_meta.php");
include_once("inc/panels/meta.php");
if (file_exists(TEMPLATE_DIR . $current_template_name . "_meta.php")) {
include_once(TEMPLATE_DIR . $current_template_name . "_meta.php");
}
?>
<script type="text/javascript">
// FancyBox init (shown above)
</script>
</head>
<body>
<div id="wrapper">
<?php include_once("inc/panels/header-home.php"); ?>
<div id="content-wrap">
<img class="fa-banner-image" src="images/common/banner-img.jpg" alt="">
<div class="container">
<div class="fa-main-content fa-signup">
<div id="content">
<h1 class="inner-heading">Take a Tour</h1>
<ul class="video_list">
<center>
<iframe width="460" height="515"
src="http://www.youtube.com/embed/Krxs2kSUzvk"
frameborder="0" allowfullscreen>
</iframe>
</center>
</ul>
<br clear="all" />
</div>
</div>
</div>
</div>
<?php include_once("inc/panels/footer-home.php"); ?>
</div>
<div id="del-confirm-dialog" title=""></div>
</body>
</html>
Key Components
- Header Panel (
inc/panels/header-home.php)
Displays the public site navigation and logo . - Banner Image
Static banner located atimages/common/banner-img.jpg. - Main Content
Wrapped in.fa-main-content, contains the page heading and a centered YouTube embed. - Footer Panel (
inc/panels/footer-home.php)
Renders contact links, site footer, and legal notices . - Delete Confirmation Dialog
A hidden<div>ready for jQuery UI dialogs (#del-confirm-dialog).
Dependency & Flow
- Config Load: Bootstraps constants, session, and template mapping.
- Optional Top Include: Inserts any template-specific header fragment.
- Meta Injection: Merges global and page-specific
<meta>and script includes. - Header: Renders the site’s header.
- Content: Displays a banner and the main “Take a Tour” section.
- Footer: Renders the site’s footer.
- Dialog Placeholder: Prepares a modal dialog container.
This modular approach keeps take_a_tour.php focused on content, while shared elements and scripts live in reusable panels and configuration files.