Panel: Small Banner

A small banner partial that displays a concise promotional message across most pages of the logistics portal. It’s a lightweight HTML snippet, included via PHP template logic, to maintain consistent branding and marketing communication.

Overview

  • Renders a brief text message within a <div> container.
  • Lives in linuxfront-v2-logistics/inc/panels/small_banner.php.
  • Included in site templates to appear above main content.

Purpose

  • 📋 Marketing: Communicates value proposition (“Let our team of professionals…”) to site visitors.
  • 🔄 Consistency: Ensures the same message shows on key pages.
  • ⚙️ Reusability: Centralizes HTML in one partial for easy updates.

File Location

File Path
Small Banner Panel linuxfront-v2-logistics/inc/panels/small_banner.php

Code Snippet

Below is the entire content of the small_banner.php partial:

<div id="sm-banner">
  <p>
    Let our team of professionals do the work leaving you
    additional time to devote to your core business.
    We make your freight decision simple and save you money!
  </p>
</div>

Integration in Templates

The banner is conditionally included in the main site templates. For example, in 21-11-2012_site_template.php:

<?php
  include_once("inc/config.php");
  include_once("inc/panels/header.php");
  include_once("inc/panels/top_nav.php");
?>
<div id="content-wrap">
  <?php
    // Only show banner if current template isn’t excluded
    if (!in_array($currnt_template, $exclude_banner))
      include_once("inc/panels/small_banner.php");
  ?>
  <?php include_once(TEMPLATE_DIR . $current_template_name . "_content.php"); ?>
</div>

Conditional Logic

The variable $exclude_banner (defined in inc/config.php) lists templates where the banner should not appear:

Template Key Reason
start_quote Quote workflow landing
fetching_rates Rate calculation page
select_carrier Carrier selection step
provide_details Shipment details form
bookit Booking confirmation
finish_shipment Shipment summary
shipment_success Success message
$exclude_banner = array(
  "start_quote",
  "fetching_rates",
  "select_carrier",
  "provide_details",
  "bookit",
  "finish_shipment",
  "shipment_success"
);

Dependencies & Relationships

  • inc/config.php
    • Defines $exclude_banner and global constants.
  • Site Templates
    • 21-11-2012_site_template.php & site_template_lastok-17-04-2014.php include the panel.
  • Styling
    • The #sm-banner ID is targeted by global CSS to control layout, spacing, and typography.

Inclusion Flow

flowchart LR
  A[User Request] --> B[route.php]
  B --> C[site_template.php]
  C -->|if not excluded| D[small_banner.php]
  D --> E[Render HTML<br/>#sm-banner]
  E --> F[Display in Browser]

Key Takeaways

  • Single Responsibility: small_banner.php only handles the banner markup.
  • Maintainability: Text edits happen in one file.
  • Config-Driven: $exclude_banner governs display logic, keeping templates clean.