Best practice for custom item citation - new plug-in?

I noticed some old forum posts regarding citations and I found this Chicago style plug-in created a couple years ago. If I wanted to customize the citation field, is the best practice to create a plug-in like that but just change things around how we want it?

Yep! A plugin that uses the item_citation filter to build it’s own citation text is the way to go. You pretty much replace the $citation default value that’s passed in then return it back. The $item object for grabbing data can also be found in the $args passed in:

$item = $args['item'];
1 Like

There is another example here :

1 Like

Here is a plugin for MLA-style citations:

1 Like

The BGSU MLA citation plugin is great but I’m having trouble with adding an item’s collection name. I’ve seen a few others in the old forum interested in adding this data element to a citation but haven’t seen anyone who has actually added it. Any help would be great.

I figured it out, but if anyone wants an answer…

$collection = get_collection_for_item();
$collectionName = metadata($collection, array(‘Dublin Core’, ‘Title’));
if ($collectionName) {
$citation .= "$collectionName, ";

You can also just do metadata('item', 'collection name');