Open dannylamb opened 6 years ago
Related drupal module: https://www.drupal.org/case-study/bibliography-and-citation-module-for-drupal-8
Has anyone played around with that bibcite module?
I tried installing it and the documentation is pretty minimal. From what I can tell, you have to create Reference entities which can then be exported in a variety of formats (you can also import reference entities). One could possibly create/edit/delete reference entities programmatically with the create/edit/delete of repository item nodes (and programmatically map fields to the reference entity fields) and relate the reference via an entity relationship. That feels like its duplicating a lot of data though. Is anyone seeing a way we could using existing fields (like say, those in islandora_defaults)? Or is there a better way to use this module?
I used Bibcite pretty extensively while making the journal install profile that powers https://journaloflmmontgomerystudies.ca/
I found it pretty useful if you want to import citations from an outside source like Refworks, and if you want to be able to easily use the styles provided.
I was able to do a little cover use of its serializer to get it to use fields from my own Article node type rather than having to put everything in to its own custom entity type which I mostly found cumbersome to deal with.
A quick sample:
$citation_tools = new CitationTools();
$citation_metadata = $citation_tools->getCitationMetadataForArticle($node);
$citation_metadata['type'] = 'journal_article';
$r = Reference::create($citation_metadata);
$serializer = \Drupal::service('serializer');
$data = $serializer->normalize($r, 'csl');
$text_citation = [
'#theme' => 'bibcite_citation',
'#data' => $data,
];
For our Islandora RDM project we decided to not use Bibcite because we only intend to have one citation format, the format given in Datacite. So I just have a Twig template for a basic data set citation which renders a Citation view mode in a block.
I was just looking at your twig template which I saw referenced in the blog post on islandora.ca. Excellent. Since I'm coming from a use case of having a variety of citation formats and a variety of content types, I'll need something more robust. Thanks for the suggestion on connecting a custom content type to bibcite!
This is a meta-issue to track the development of a dynamic citation generation feature. Please refer to this issue in any subsequent issues to link the two.
Scholar in 7.x had the ability to generate citations in various formats, driven by object metadata. We should port this functionality forward to CLAW, but maybe with less xslt's...