How can I get the text to stop displaying on the other pages?

I installed the plugin Hide Elements and used that to hide the full text pulled from PDFs using the plugin PDF Text. I didn’t want it displaying on the records and pages of the site because it looks bad and these PDFs have 100-200 pages at times so its a lot of junk in the record.

What I did was move the PDF text that was pulled in the file record to the Item record and put it in the “Text Element.” I used the Hide Element plugin to then hide that field from public view but left it open to searching. This way it provides full text searching without the public having to see the actual text on the record page.

Now the problem is that when you go into browse modes you see the full text displayed. For example, if you go into “Browse Collections” and click on the collection that has all the yearbooks in it, a list appears showing the yearbooks and part of the data that is being displayed is the full text that is supposed to be hidden. Any ideas how I keep that from being displayed on other pages in Omeka? I included a screen shot. All the random text under each image should be hidden, or at least that’s what I want. I don’t mind if its the item description, but not the textual data.

I should note that it only seems to do this on the “Browse Collections” page and no where else. If you browse items, it looks great and exactly how I want it to look under Browse Collections.

That seems to hit a special case that the Hide Elements plugin doesn’t address. The workaround is to do a little work to override a default template in your theme.

First, copy the default collections/show.php file following the instructions here.

Then, look for these lines:

            <?php if ($text = metadata('item', array('Item Type Metadata', 'Text'), array('snippet'=>250))): ?>
            <div class="item-description">
                <p><?php echo $text; ?></p>
            </div>
            <?php elseif ($description = metadata('item', array('Dublin Core', 'Description'), array('snippet'=>250))): ?>
            <div class="item-description">
                <?php  echo $description; ?>
            </div>
            <?php endif; ?>

If you don’t want to show the descriptions, delete all of the lines. If you do want to show the description when there is one, modify that block of code to this:

            <?php if ($description = metadata('item', array('Dublin Core', 'Description'), array('snippet'=>250))): ?>
            <div class="item-description">
                <?php  echo $description; ?>
            </div>
            <?php endif; ?>

Sorry about that. I was being dense and just completely missed it. I deleted the last post because of that.

Awesome. I got it to work. Thank you much!

I am a bit confused though as to why I had to create the new directory in default. When I added the show.php file there, nothing happened. I had to actually change the one in the application/views/scripts/collections directory to get it to work.

It’ll be a bit safer to try to get the override to work, rather than changing application/views/scripts/collections/show.php file. That because when an update to Omeka comes along, it will delete your changes.

It looks like you are using the Emiglio theme, so the changed file would under emiglio (or whatever your theme is named), not default