Skip to content

Instantly share code, notes, and snippets.

@kimisgold
Created June 11, 2012 22:32
Show Gist options
  • Save kimisgold/2913134 to your computer and use it in GitHub Desktop.
Save kimisgold/2913134 to your computer and use it in GitHub Desktop.
Example of creating a list of links using a Simple Vocab term
<li>Time Period
<?php
$db = get_db();
$timePeriodId = $db->getTable('Element')->findByElementSetNameAndElementName('Item Type Metadata', 'Time Period')->id;
$timePeriodTexts = explode("\n", $db->getTable('SimpleVocabTerm')->findByElementId($timePeriodId)->terms);
if($timePeriodTexts) {
echo '<ul class="sub-menu">';
foreach($timePeriodTexts as $timePeriodText) {
echo '<li>' . bc_link_to_items_with_element_text($timePeriodText, array(), 'browse', $timePeriodId, $timePeriodText) . '</li>';
}
echo '</ul>';
}
?>
</li>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment