Removing the citation box

I would like to remove the citation box from any item. I figured the best way to remove a citation would be to create a plugin. Following the item_citation documentation here - https://omeka.readthedocs.io/en/latest/Reference/filters/item_citation.html, I was able to get the citation box to display nothing, but the citation box still appears on the item page (attached). How can I get this portion of the citation to also not appear?

My code is:

<?php

class AmplificationCitationPlugin extends Omeka_Plugin_AbstractPlugin
{
    protected $_filters = array('item_citation');

    public function filterItemCitation($citation, $args)
    {
        $citation = '';
        return $citation;
    }
}

By the way, I believe there is an error in the linked documentation; the fifth line of code under Examples is missing “function” and should read:

    public function filterItemCitation($citation, $args)

You’ve got two options: you can use CSS to just not show that box, so adding something like:

#item-citation {
    display: none;
}

To the theme’s CSS, or using the CSS Editor plugin would do the trick.

Or you can just edit the theme to not show the box at all, by editing the theme’s items/show.php file, and looking for and removing these lines:

    <!-- The following prints a citation for this item. -->
    <div id="item-citation" class="element">
        <h2><?php echo __('Citation'); ?></h2>
        <div class="element-text"><?php echo metadata('item', 'citation', array('no_escape' => true)); ?></div>
    </div>

Thanks for the heads up on the mistake in the citation example, it’s now fixed and that page should update to reflect the fix soon.

Aha that does it! Thank you so much. This also is the solution to my other question (Removing metadata descriptors).

This topic was automatically closed after 250 days. New replies are no longer allowed.