Created
June 26, 2015 14:09
-
-
Save erochest/1bb6304fe536da611bfa to your computer and use it in GitHub Desktop.
How to show the links to the Neatline item from the Omeka item's page
This file contains hidden or 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 | |
| $db = get_db(); | |
| $id = get_current_record('item')->id; | |
| $sql = "SELECT id, title, exhibit_id FROM {$db->prefix}neatline_records " . | |
| "WHERE {$db->prefix}neatline_records.item_id=?;"; | |
| $result = $db->query($sql, array($id)); | |
| $rows = $result->fetchAll(); | |
| $exhibits = $db->getTable("NeatlineExhibit"); | |
| if (! empty($rows)) { | |
| ?> | |
| <div id="neatline-links" class="element"> | |
| <h3><?php echo __('Neatline Items'); ?></h3> | |
| <ul> | |
| <?php | |
| foreach ($rows as $row) { | |
| $exhibit = $exhibits->find($row['exhibit_id']); | |
| $url = nl_getExhibitUrl($exhibit, "fullscreen"); | |
| if (empty($row['title'])) { | |
| $title = metadata('item', array('Dublin Core', 'Title')); | |
| } else { | |
| $title = $row['title']; | |
| } | |
| echo "<li><a href='{$url}#records/{$row['id']}'>{$title}</a> "; | |
| echo "in {$exhibit->title}</li>"; | |
| } | |
| ?> | |
| </ul> | |
| </div> | |
| <?php | |
| } | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment