Created
June 11, 2012 22:32
-
-
Save kimisgold/2913134 to your computer and use it in GitHub Desktop.
Example of creating a list of links using a Simple Vocab term
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
<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