Forums » Tags not displaying

RSS feed for this topic

Info

  1. I imported my data via CSV importer and have decided to add some tags via manually editing but they do not appear in my customized item display.

    I assume that my code is messed up, because tags appear in other non-modified templates.

    Here is how my show.php file is coded:

    http://library.gc.cuny.edu/access/show.txt

    What might be missing wrong with it?

  2. Your link is showing a 403 error when I click it. Can you possibly just paste your code here on this page?

  3. <?php head(array('title' => item('Dublin Core', 'Title'),'bodyid'=>'items','bodyclass' => 'show item')); ?>

    <div id="primary">

    <ul class="item-pagination navigation">
    <li id="previous-item" class="previous">
    <?php echo link_to_previous_item('Previous Item'); ?>

    <li id="next-item" class="next">
    <?php echo link_to_next_item('Next Item'); ?>

    <h1><?php echo item('Dublin Core', 'Title'); ?></h1>

    <div class="item-image">

    <?php echo display_files_for_item(array('imageSize'=>'fullsize')); ?>

    </div>

    <div class="element">
    <h3>All Titles</h3>
    <ul class="title-list">
    <?php foreach (item('Dublin Core', 'Title', 'all') as $title): ?>
    <li class="item-title">
    <?php echo $title; ?>

    <?php endforeach ?>

    </div>

    <!-- The following function prints all the the metadata associated with an item: Dublin Core, extra element sets, etc. See http://omeka.org/codex or the examples on items/browse for information on how to print only select metadata fields. -->

    <div class="element-text">
    <div id="item-tags" class="element">
    <h4><b>Title:</b></h4>
    <?php echo item('Dublin Core', 'Title'); ?>
    </div></div>

    <div class="element-text">
    <div id="item-tags" class="element">
    <h4><b>Format:</b></h4>
    <?php echo item('Dublin Core', 'Format'); ?>
    </div></div>

    <div class="element-text">
    <div id="item-tags" class="element">
    <h4><b>Date:</b></h4>
    <?php echo item('Dublin Core', 'Date'); ?>
    </div></div>

    <div class="element-text">
    <div id="item-tags" class="element">
    <h4><b>Street Address:</b></h4>
    <?php echo item('Dublin Core', 'Spatial Coverage'); ?>
    </div></div>

    <div class="element-text">
    <div id="item-tags" class="element">
    <h4><b>Photographer/Artist:</b></h4>
    <?php echo item('Dublin Core', 'Creator'); ?>
    </div></div>

    <div class="element-text">
    <div id="item-tags" class="element">
    <h4><b>Description:</b></h4>
    <?php echo item('Dublin Core', 'Description'); ?>
    </div></div>

    <?php
    $subjects = item('Dublin Core', 'Subject', 'all');
    if (count($subjects) > 1):
    ?>
    <div class="element-text">
    <div id="item-tags" class="element">
    <h4><b>Subjects:</b></h4>
    <ul class="subject-list">
    <?php foreach ($subjects as $subject): ?>
    <li class="subject">
    <?php echo $subject; ?>
    <?php endforeach; ?>
    <?php endif; ?>
    </div></div>

    <div class="element-text">
    <div id="item-tags" class="element">
    <h4><b>Rights:</b></h4>
    <?php echo item('Dublin Core', 'Rights'); ?>
    </div></div>

    <div class="element-text">
    <div id="item-tags" class="element">
    <h4><b>Contributing Institution:</b></h4>
    <?php echo item('Dublin Core', 'Contributor'); ?>
    </div></div>

    <div class="element-text">
    <div id="item-tags" class="element">
    <h4><b>Tags:</b></h4>
    <?php if (item_has_tags()): ?>
    <?php echo item_tags_as_string(); ?>
    </div></div>

    <!-- The following returns all of the files associated with an item. -->
    <div id="itemfiles" class="element">
    <h3>Thumbnail (Click Image to See Fullsize):</h3>
    <div class="element-text"><?php echo display_files_for_item(); ?></div>
    </div>

    <?php echo geolocation_google_map_for_item($item,$width='200',$height='200'); ?>

    <!-- If the item belongs to a collection, the following creates a link to that collection. -->
    <?php if ( item_belongs_to_collection() ): ?>
    <div id="collection" class="element">
    <h3>Back to Collection Home</h3>
    <div class="element-text"><p><?php echo link_to_collection_for_item(); ?></p></div>
    </div>
    <?php endif; ?>

    <!-- The following prints a citation for this item. -->

    <ul class="item-pagination navigation">
    <li id="previous-item" class="previous">
    <?php echo link_to_previous_item('Previous Item'); ?>

    <li id="next-item" class="next">
    <?php echo link_to_next_item('Next Item'); ?>

    <?php echo plugin_append_to_items_show(); ?>

    </div><!-- end primary -->

    <?php foot(); ?>

  4. I'm guessing your page probably dies right after the h4 'Tags', i.e. nothing appears after that. You need to close the if statement: <?php if (item_has_tags()): ?>.

    So your block of code for the Tags should be:

    <div class="element-text">
    <div id="item-tags" class="element">
    <h4><b>Tags:</b></h4>
    <?php if (item_has_tags()): ?>
    <?php echo item_tags_as_string(); ?>
    <?php endif; ?>
    </div></div>
  5. Thank you very helpful.

Reply

You must log in to post.