I would like to make three changes to the Item display page for the public: move the universalviewer above the metadata, break the metadata into two columns, and remove "Files" from the metadata

I included a link below to an example of an item’s record. I’d like to try and complete three changes to this page for every item.

The first is the move the UniversalViewer to the top of the page, above all the metadata. If you scroll down, and you have to scroll down a ways, you will see it at the bottom and I just think it might be more accessible having it at the top where people see it immediately.

Below it I’d like to have the metadata and I was wondering if anyone knew how to divide the metadata display into two equal columns below the universal viewer. I am trying to eliminate so much white space, make it more compact and require less scrolling if possible.

I’d also like to hid the “Files” from displaying since they are in the UniversalViewer; however, I do not see that as an option in the hide elements plugin I already have installed and am using for other elements.


Thank you! I really appreciate the help!

For the first one, moving UniversalViewer to the top, one option is to use the get_specific_plugin_hook() function. That’ll let you insert that where you need it in your theme’s files (looks like you have a solid handle on theme customization, but please ask followup questions about where to do that if needed).

That will still duplicate the output at the bottom, though, as the usual behavior at the bottom is to echo out what comes from all the plugins. Currently, it looks like that’s the only plugin producing output, so you might be able to just remove the fire_plugin_hook() call from the bottom of the show files. If you need a mix, that’s a little trickier, but doable.

Strictly speaking, “Files” are not elements, so HideElements won’t influence that. Again, in the theme’s files, look for something like this:

<?php if (metadata('item', 'has files')): ?>
<div id="itemfiles" class="element">
    <h3><?php echo __('Files'); ?></h3>
    <div class="element-text"><?php echo files_for_item(); ?></div>
<?php endif; ?>

and delete the lines.

Thank you for the help. I have a decent understanding of HTML and CSS but I am not very good at all at PHP. Would you be able to tell me what files I need to edit to move the UniversalViewer? I’m not sure which ones need that added.

I was able to delete the lines of code to remove the file element from displaying. Thank you!

Ok. I copied and pasted the line “<?php fire_plugin_hook('public_items_show', array('view' => $this, 'item' => $item)); ?>” out of the show.php file in the Items directory under the theme and moved it up to the top of the file before all the other metadata displays and it moved the UniversalViewer to the top of the page.

I also got rid of the File element by deleting the code you said. Thank you a gain for that. Now I just need to see about dividing the metadata into two columns below the universal viewer.

What I am thinking is if I could have all the metadata elements up until “Format” display on the left and the rest on the right, that should be sufficient to break up the long white spaces that come with having it in one column. I just am not sure where to create the columns at, which files need to have them put in.

That sounds like some CSS trickery that you are probably better at than me!

In the files that you are already working with, I’d wrap things in some <div>s, with classes as needed. Then, target the styles for columns based on that. Overriding the default metadata_browse might be what you need to switch out what goes into what divs.

Thank you for the help. I’ll have to see what I can do. Thankfully this is more of a preference than a necessity at this time. It can wait until I have more time to figure it out.

I’m also trying to remove the files from the public display and tried to delete the code you suggested from the Theme files. I tried a bunch of different files (single.php ; show.php ; browse.php) and none of them worked. Do you know which file in particular I should target? I didn’t see the exact code, but your earlier message suggested some variability. Kindly advise and thanks!

I have appreciated this thread and the suggestions that were made. I removed the “Files” code from the “Items” show.php file and also moved the UniversalViewer to the top of the page. However, I am also using the Commenting and Geolocation plugins and when I move the code: " <?php fire_plugin_hook('public_items_show', array('view' => $this, 'item' => $item)); ?> " toward the top of the show.php file and it moved all three of those plugin visuals to the top. I want the UniversalViewer at the top, and the Commenting and Geolocation at the bottom.

Any suggestions on how to fix this would be awesome. I am a newbie to this kind of stuff, but follow directions very well. Haha. Here is a link to one o0f the item pages with the current issue I have described. http://www.arichhistory.com/items/show/1#?c=0&m=0&s=0&cv=0

Thanks in advance!