Image Annotation

17 views
Skip to first unread message

Sheila Cheung Sze Lui

unread,
Nov 6, 2012, 5:13:47 AM11/6/12
to omek...@googlegroups.com
Hi,
 
I am new to OMEKA and is now testing out to add image annotation.  I have installed the plugin and have it add to the public theme.  Since this will apply to all items, I wonder if there is way to control Image Annotation be applied to only a specific collection / item. 
 
Thanks much in advance for your advise. 
 
Best,
Sheila

Jeremy Boggs

unread,
Nov 6, 2012, 8:43:08 AM11/6/12
to omek...@googlegroups.com
Sure, you could wrap that function with an if statement, and check for something, like the item ID:

<?php

// Only use ImageAnnotation for the Item with ID of 20.
if (item('id') == 20) {
echo image_annotation_display_annotated_image_gallery_for_item();
}

?>

You could do any number of checks here, depending on what exactly you'd like to check for. If its just one specific item, the ID is probably the easiest. But you could check to see if the item is in a certain collection, has a certain tag, or is a certain type. Here's how you'd check if the Item is in a specific collection:

<?php

if (item_belongs_to_collection('Name of Collection')) {
echo image_annotation_display_annotated_image_gallery_for_item();
}

?>

You can check out the Functions Reference <http://omeka.org/codex/Functions> for more ways of checking for certain conditions on an Item, or anything else in Omeka.

It's also good to note that the methods for doing this would be different for Omeka 2.0.

Best,
Jeremy
> --
> You received this message because you are subscribed to the Google Groups "Omeka Dev" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/omeka-dev/-/gvKfhDGv-aMJ.
> 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.

Reply all
Reply to author
Forward
0 new messages