Hiding or changing the heading 'Dublin Core' that appears on /items/show.php

810 views
Skip to first unread message

Merrin B.

unread,
Nov 21, 2011, 4:59:27 PM11/21/11
to Omeka Dev
Apologies if the answer is obvious....

I am trying to hide or change the heading 'Dublin Core' that appears
on /items/show.php. It appears to wrapped up in the following: <?php
echo custom_show_item_metadata(); ?>

It displays on a web page as <h2>Dublin Core</h2>.

Has anyone successfully achieved hiding/deleting this or other parts
of the item metadata?

Thanks for your help,

Merrin (University of Otago Library, Dunedin, New Zealand)

sdj loret

unread,
Nov 21, 2011, 5:33:05 PM11/21/11
to omek...@googlegroups.com
Hi Merrin,

Certainly you have a custom.php in your theme's folder. In this file, you'll find in function custom_show_item_metadata() the h2 tag and you can change it.

Best,

Sdj

2011/11/21 Merrin B. <brews...@gmail.com>



--
You received this message because you are subscribed to the Google Groups "Omeka Dev" group.
To post to this group, send email to omek...@googlegroups.com.
To unsubscribe from this group, send email to omeka-dev+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/omeka-dev?hl=en.


Jeremy Boggs

unread,
Nov 21, 2011, 8:42:32 PM11/21/11
to omek...@googlegroups.com
The answer is not quite so obvious, but pretty easy to implement.

There is a template file, 'item-metadata.php', in application/view/scripts/items, that governs the display of item metadata. custom_show_item_metadata(), which uses show_item_metadata(), uses this template file for formatting.

If you want to remove the 'Dublin Core' heading, you could just copy the 'item-metadata.php' file to your own theme (in theme-name/items/), and remove the line '<h2><?php echo html_escape(__($setName)); ?></h2>'. this will remove the Dublin Core heading, adn all subsequent headings for element sets. (I wouldn't recomment directly editing application/views/scripts/item-metadata.php, since you would potentially lose those changes with any upgrades.)

If you only want to remove it for Dublin Core, you could just do a check on $setName, something like this:

<?php if ($setName != 'Dublin Core'): ?>
<h2><?php echo html_escape(__($setName)); ?></h2>
<?php endif; ?>

While you're at it, you can of course modify any of the other HTML for element sets, element names, and values as you'd like in this template file.

Best,
Jeremy

sdj loret

unread,
Nov 22, 2011, 1:45:27 PM11/22/11
to omek...@googlegroups.com
Yes, of course, so confused...

sdj


2011/11/22 Jeremy Boggs <jer...@clioweb.org>

Merrin B.

unread,
Nov 27, 2011, 5:49:53 PM11/27/11
to omek...@googlegroups.com
Thank you Jeremy!! That suggestion worked perfectly.

Kind regards,

Merrin

Durrell Bowman

unread,
Jul 15, 2012, 11:59:24 AM7/15/12
to omek...@googlegroups.com
I'm also trying to get rid of those h2 headings, which are going to be confusing for most people, and they show up even when irrelevant and without data for people not logged in (such as with Comments, for example).  I've gotten rid of that line in a copy of item-metadata.php in my theme folder (dark), tried putting that modified file in a subdirectory called "items" in that theme folder (because there wasn't one), and in desperation even tried taking the line out of the template version. However, none of these things worked, and the h2 headings seem to be stuck there.  Help!

> To unsubscribe from this group, send email to omeka-dev+unsubscribe@googlegroups.com.

Durrell Bowman

unread,
Jul 15, 2012, 12:26:01 PM7/15/12
to omek...@googlegroups.com
Followup: The h2 headings actually are going away, but only starting with the Dublin Core one, which I've moved nearer the bottom (instead of leaving it at the top). I wanted the discussion element nearer to the top, so the Comments h2 heading stays there. I'd still like to hide the "Comments" heading (because it's going to be confusing for people not logged in and not having that permission), and I'd also like to change at least the name of the "Comment" field to "Discussion." Where would I do that? Thanks.

Jeremy Boggs

unread,
Jul 15, 2012, 5:21:01 PM7/15/12
to omek...@googlegroups.com
The Comments heading sounds like it's getting added separately, by a plugin, using the 'append_to_items_show' plugin hook, and not through the item metadata itself. If you are using a plugin, which one is it? I can poke around the plugins code to see where it might be added.

Jeremy

To view this discussion on the web visit https://groups.google.com/d/msg/omeka-dev/-/J8E4J31KxeEJ.

To post to this group, send email to omek...@googlegroups.com.
To unsubscribe from this group, send email to omeka-dev+...@googlegroups.com.

Durrell Bowman

unread,
Jul 16, 2012, 12:02:08 AM7/16/12
to omek...@googlegroups.com
Thanks, Jeremy. I got it. It's the Commenting plugin, and I changed the h2 header from "Comments" to "Discussion of the Content of This Item" in plugins/Commenting/helper/commenting.php and the element label from "Comment" to "Your Contribution" in plugins/Commenting/CommentForm.php.

Chris Pollitt

unread,
Feb 16, 2013, 2:21:38 PM2/16/13
to omek...@googlegroups.com
Easiest way is via css.

Add these lines below the "h2 {...}" block in "themes/default/css/style.css" file:

.element-set h2 {
   display:none;

Gus Urban

unread,
Feb 28, 2013, 7:47:46 AM2/28/13
to omek...@googlegroups.com
Jeremy
sorry for my question but I need the line dublin core in my display of elements.....but I don't understand any..


El lunes, 21 de noviembre de 2011 22:42:32 UTC-3, Jeremy Boggs escribió:
The answer is not quite so obvious, but pretty easy to implement.

There is a template file, 'item-metadata.php', in application/view/scripts/items, that governs the display of item metadata. custom_show_item_metadata(), which uses show_item_metadata(), uses this template file for formatting.

What is the file that has the template file, 'item-metadata.php', in application/view/scripts/

items?


 

If you want to remove the 'Dublin Core' heading, you could just copy the 'item-metadata.php' file to your own theme (in theme-name/items/),

I use theme seasons and in my directory I have two files

random-featured.php  show.php

sorry for my questions

gus

 

Jeremy Boggs

unread,
Feb 28, 2013, 12:39:05 PM2/28/13
to omek...@googlegroups.com
On Feb 28, 2013, at 7:47 AM, Gus Urban <gusun...@gmail.com> wrote:

What is the file that has the template file, 'item-metadata.php', in application/view/scripts/

items?

the item-metadata.php file was replaced by common/record-metadata.php. That template isn't included by another file, but rather is used by the view helpers for displaying record metadata.

If you want to remove the 'Dublin Core' heading, you could just copy the 'item-metadata.php' file to your own theme (in theme-name/items/),

I use theme seasons and in my directory I have two files

random-featured.php  show.php

sorry for my questions

So yeah, if you want to change the output that's governed by that template, first you'd need to copy the core file to your own theme.

Copy: your_omeka_dir/applications/views/scripts/common/record-metadata.php

To: your_omeka_dir/themes/seasons/common/record-metadata.php

If your Seasons theme doesn't have a directory called 'common' you'll need to create that directory first.

And then edit the file in your theme as you wish. The Omeka codex has a good page explaining the relationship between Omeka's core view files and custom themes:


Best,
Jeremy

Gus Urban

unread,
Feb 28, 2013, 2:45:23 PM2/28/13
to omek...@googlegroups.com
Jeremy
also work ok with these
it is ok or not?
gus

now I see the problem..
the file
record-metadata.php
that is in the directory
var/www/application/views/scripts/common#

In these file I must remove the line


<?php echo html_escape(__($setName)); ?></h2>

Thanks
Gus

Reply all
Reply to author
Forward
0 new messages