How to make metadata linkable


So, "link_to_collection_for_item()" will make Collection Name linkable in show.php page and filtered accordingly.

Also, "tag_string" makes Tags linkable and filtered accordingly.

How can I make Dublin Core metadata (i.e. Source) linkable in my Show.php page so that when clicked, they return all Items having the same value in the particular metadata?

The SearchByMetadata plugin does that, but it has not been released or updated for 2.0 yet. It should be coming along soon.

Take your time! Given the opportunity, I can't stress enough what a great job you did with v2.0. Clean, simple, powerful!

You can accomplish some of this functionality by modifying your theme and looking at the url parameters from search results. For example, if you do an advanced search for items with the subject term "Education," the URL for the results looks like...[0][element_id]=49&advanced[0][type]=contains&advanced[0][terms]=Education&submit_search=Search

So if you added the following code (or something similar) to items/show.php, you could turn subjects into links...

$subjects=item('Dublin Core','Subject', array('all' => true));
if ($subjects){
$subject_html = '<div class="item-actions"><div class="element-text"><h4>Subjects:</h4> ';
foreach($subjects as $subject){
    $subject_html .= ($count>0) ? ', ' : '';
    $subject_html .= '<a href="'.uri($location).'">'.$subject.'</a>';
$subject_html .= '</div></div>';
echo $subject_html;

This should be modifiable to link other metadata fields as well, but you'll need to keep a couple caveats in mind.

One, this code is for pre-Omeka 2.0, so it would need to be slightly modified going forward (updating uri() to url() and item() to get_current_record(), I think). Secondly, this may mean you need to manually retrieve all your metadata fields, otherwise you might end up with duplicates. So it complicates things a bit.

Thanks for your time though! I may give it a try while I wait for Patrick's plugin.

One little clarification: get_current_record is the new general replacement for get_current_item and its other record-specific friends.

metadata is the replacement for item, collection, item_file, etc.