Skip to content

Instantly share code, notes, and snippets.

@emartinez-usgs
Last active August 29, 2015 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emartinez-usgs/11158054 to your computer and use it in GitHub Desktop.
Save emartinez-usgs/11158054 to your computer and use it in GitHub Desktop.
Example Using ImageList Content Pattern
<?php
if (!isset($TEMPLATE)) {
$TITLE = 'Page Title';
// Add the CSS to your page for default styles
$HEAD = '
<link rel="stylesheet" href="/css/imagelist.css"/>
';
// Include the class definition
include 'classes/ImageList.class.php';
include 'template.inc.php';
}
// Some variables used to add an item to the list
$linkUrl = 'http://some.host.com/some/page/';
$imageSource = 'http://placehold.it/200x200';
$itemTitle = 'This is the title for this list item';
$itemMarkup = 'This is the content for this list item. It may contain any HTML.';
// Create a new image list
$list = new ImageList();
// Add an item to the list (generally will be done more than once)
$list->addItem($linkUrl, $imageSource, $itemTitle, $itemMarkup)
// Show the list in the page
$list->display();
<!-- Placeholder for Gist Title -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment