This wraps a bunch of lists in an article for modals
// find what I am looking for
if (preg_match_all("'<h4>(.*?)</h4>\n?<dl id=\"(.*?)\">(.*?)</dl>' si", $this->item->introtext, $matches)) :
$lists = array();
// adjust array so I know what I am working with a better
for($i = 0; $i < count($matches[0]) ; $i++)
{
// preg match all creates an array for each item wrapped in parens after full match
$lists[$i] = new stdClass();
$lists[$i]->name = $matches[1][$i];
$lists[$i]->id = $matches[2][$i];
$lists[$i]->data = $matches[3][$i];
} ?>
<div class="row-fluid">
<?php foreach($lists as $list) : ?>
<a class="btn btn-large btn-block" href="#<?php echo $list->id; ?>" data-toggle="modal"><?php echo $list->name; ?></a>
<?php endforeach; ?>
<?php foreach($lists as $list) : ?>
<div id="<?php echo $list->id; ?>" class="modal hide fade" tabindex="-1">
<div class="modal-header"><button class="close" type="button" data-dismiss="modal">×</button>
<h3><?php echo $this->item->category_title; ?> - <?php echo $list->name; ?></h3>
</div>
<div class="modal-body">
<dl>
<?php echo $list->data; ?>
</dl>
</div>
<div class="modal-footer"><button class="btn" data-dismiss="modal">Close</button></div>
</div>
<?php endforeach; ?>
<?php endif; // end here ?>