Last active
August 29, 2015 14:00
-
-
Save emartinez-usgs/11158054 to your computer and use it in GitHub Desktop.
Example Using ImageList Content Pattern
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Placeholder for Gist Title --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment