This is my custom items/show.php! (v2.0)

Hi all,

I have no programming skills but I can understand code structure and hack bits of it here and there.

So, here is my new custom items/show.php

Black text is static, brown is dynamic. The font is "Open Sans Condensed" by Google Free fonts. Vertical scrolling is eliminated and now every kind of item's available information is grouped in a coherent layout.

Your comments/suggestions/ideas are most welcome!

Nice! Indeed, it condenses the info nicely. Any plans to make the code available?

Ok, step-by-step (maybe useful even for my own future reference):

Step #1: First, I added a background image throughout the site ("Thanks Roy" was initially blank). In .../themes/default/css/style.css line 60, I added the proper reference by pointing to the path of the background image in my server.

body {
background-image:url('YOUR DIRECTORY PATH HERE/bg.png');

Step #2: I chose a custom font (Open Sans Condensed) from Google Web fonts ( and installed according to instructions given at the Web Fonts website (needs a reference in your style.css and one in your header.php).

Step #3: I copied the .../application/views/scripts/items/show.php into the .../themes/default/items directory. All changes were made in the copied file (else, you get generic changes in all installed themes).

Step #4: My goal was to eliminate vertical scrolling in the Item's show page (show.php file) and at the same time to create a visually more "control-panel"-like interface with all information grouped in one place. So, I decided to go on with simple tables.

Step #5: Dublin Core Element Site has 15 metadata fields while various Item Type Elements' metadata sum to over 40 or 50. Do I need them all? No. So I did some basic conceptual modelling by ruling-out unnecessary info. I ended up with much less metadata fields, ready to be "echoed" in my tables.

Step #6: I designed 2 tables. The upper one displays the Dublin Core metadata, which are considered to be the "basic" or most fundamental attributes of a given concept. The lower one is used to display selected information from Item Type Elements (which, by the way, I modified to meet my needs).

Step #7: The code of the first, upper table is the following (structure is repeated so I quote just a few lines):

table width="100%" border="0">
<td width="5%" bgcolor="#CCCCCC">Title:</td>
<td colspan="4"><h3><?php echo metadata('item', array('Dublin Core', 'Title')); ?></h3></td>
<td width="5%">Description:</td>
<td colspan="4"><h5><?php echo metadata('item', array('Dublin Core', 'Description')); ?></h5></td>
<td width="5%" bgcolor="#CCCCCC">Subject:</td>
<td width="45%"><h5><?php echo metadata('item', array('Dublin Core', 'Subject')); ?></h5></td>
<td width="5%" bgcolor="#CCCCCC">Creator:</td>
<td width="45%"><h5><?php echo metadata('item', array('Dublin Core', 'Creator')); ?></h5></td>
<td width="45%" rowspan="7"><?php if (metadata('item', 'has files')): ?><?php echo files_for_item(); ?></td>
<td width="5%">Source:</td>
<td width="45%"><h5><?php echo metadata('item', array('Dublin Core', 'Source')); ?></h5></td>
<td width="5">Publisher:</td>
<td width="45%"><h5><?php echo metadata('item', array('Dublin Core', 'Publisher')); ?></h5></td>

Step #8: The code of the second, lower table is the following (structure is repeated so I quote just a few lines):

<td colspan="21"><center>Είδος Αντικειμένου: <h8><?php echo metadata('item', 'item type name'); ?></h8></center></td>
<td rowspan="7" bgcolor="#CCCCCC">
<h5><svg height="150" width="16" xmlns="">
<text transform="rotate(270, 9, 0) translate(-90,4)">Έγγραφο</text>
<td><h7><?php echo metadata('item', array('Item Type Metadata', 'Pages')); ?></h7></td>
<td rowspan="7" bgcolor="#CCCCCC"><h5><svg height="170" width="16" xmlns="">
<text transform="rotate(270, 12, 0) translate(-90,4)">Video</text>
<td> </td>
<td rowspan="7" bgcolor="#CCCCCC"><h5><svg height="150" width="16" xmlns="">
<text transform="rotate(270, 12, 0) translate(-90,2)">Newspaper</text>

(excuse the Greek!)

I also used some svg code to display Item Type labels vertically, to save space.

I guess this was it. I now have a tidier workspace and Items, in my eyes, feel more "organized". This is a work in progress and I will keep you posted in this thread about any new modifications.

Oh, and Omeka Team: Thank you so very much!!!


could we use database query from this show.php file??

would you like to show me how to build an effective query from this file? because i used

$db = $this->getDb();
$stmt = $db->query("SELECT * FROM tb_oauth WHERE id_oauth = 'box_sandbox'");
$OAUTH = (array)$stmt->fetchObject();

and it returned some errors.. make me confused.. please help me.. i am newbe :)


You should open another thread, this is not related to this one.

Technically, you can use database query from theme, but this is not recommended. Omeka and Zend follow the MVC (model-view-controller) architecture, so in theme (view), you should just apply a display to data you get from the controller. So this query should be done in a specific plugin.


Daniel Berthereau
Infodoc & Knowledge management