Editing citations on omeka

I am looking for very clear instructions on how to modify the Omeka citation function so that it pulls the name of the original primary source newspaper instead of the website, as indicated in Chicago Manual of Style. Here is how our site currently sites articles in papers: http://informationwanted.org/items/show/1094

I’ve read this thread through with interest: Best practice for custom item citation - new plug-in?. But I am unclear if any of this applies to our current problem.

Can someone please provide clear instructions for someone who is a bit afraid of digging in to the code?

You could do this with a plugin that filters the item citation function. For that route, you might find this repo useful. It was made for a specific project, so you would need to modify it, but this is about as simple as plugins get.

Alternately, you could write a custom theme function (the code would look similar to the above but would be placed in the custom.php file of your theme) and use that in place of item_citation() in your theme’s items/show.php file.

For example, put something like this in your theme’s custom.php file…

function my_custom_citation($item){
        $publication = option('site_title');
        
        $title = metadata($item,array('Dublin Core','Title')) ? metadata($item,array('Dublin Core','Title')) : null;
        
        $source = metadata($item,array('Dublin Core','Source')) ? ' '.metadata($item,array('Dublin Core','Source')) : null;
        
        $today = date("F j, Y");
        
        $url = WEB_ROOT.'/items/show/'.$item->id;
		$citation = $title.'. <em>'.($source ? $source : $publication).'</em>, accessed '.$today.', '.$url;
        return $citation;
}

…then put this in your theme’s items/browse.php file.

my_custom_citation($item);
1 Like