Closed kstapelfeldt closed 7 months ago
Bibcite is in dev but should have a release soon. They have a social media presence with people using BibCite in the dev version. ttps://www.adcisolutions.com/knowledge/five-use-cases-highlight-benefits-bibliography-citation-project
Can we make this work with our content type, and how?
@ravence has a "select citation" form and csl uploaded and used elsewhere. Wants form to show up on node displays and then after submission use ajax or something to get citation from the node, but is not sure how to get the node from a block or view.
@Natkeeran if you do this as a block, you can pass in any number of tokens from the block. If we choose to go that route (put citation generation as a block) you could do this with tokens. It will also be available from the javascript level (through the variable). Can define a service in your module and call the service to return JSON or HTML response that can be displayed on the front end. https://www.drupal.org/docs/drupal-apis/services-and-dependency-injection/services-and-dependency-injection-in-drupal-8
In a block in the node, but not pulling data. Still working on it!
Now pulling data from the node:
Right now it's assuming that everything is a book, but I think that we can use the genre field to guess the type.
Install a taxonomy vocabulary based on: https://aurimasv.github.io/z2csl/typeMap.xml and then allow a user to identify in configuration where this vocabulary will exist in content types for generation of the citation.
stripping Italics issue due to security challenge (prevent script injection) - Lara found a workaround. See also: https://www.drupal.org/project/bibcite/issues/3065463
Suggestion:
The Citation generation module installs a fixed Taxonomy vocabulary called Citation Vocabulary based on the [Citation Style Language] and provides a block that needs to be placed on the pages where users should be able to generate citations. It also requires mapping fields in an existing content type so that the citation can be properly managed. You can update the mapping in the configuration pane for the module.
In order to allow a content type to generate a citation, this Citation Vocabulary vocabulary needs to be referenced from an existing entity in one of your content types. Please add or configure the field you would like to reference this vocabulary. Properly configured fields will appear in a list in the configuration of the module.
Once a field is configured, it will be mapped this way if it appears in one or multiple content types.
Dream scenario: A table/matrix that displays all machine names in the system and makes them available for mapping to a fixed vocabulary required by citation generation.
Other wish-list items: Export formats (such as RIS and marc, especially)
Formatting styles are pulled directly from Bibcite, so adding new styles to Bibcite will also enable them in the block.
CSL fields can be mapped to existing node fields, which are selected from dropdowns in settings.
Assigned mappings can be reused across different content types, assuming that the machine name of the field is the same.
Wow so great! As per our meeting this morning, I understand you will be testing against plain Drupal, Islandora, and Islandora Lite playbook.
Will also scope out the export in RIS and MarcXML
Did some testing: the module installs and citations display properly on Drupal and Islandora Lite playbook. I had some trouble working with the Islandora sandbox, so I have not been able to test there.
Also, a few of the listed fields (e.g. id
, title
, created
, etc) cause errors because they need to be accessed differently: will probably need to write more specific cases or truncate the options a little bit.
We went through specific cases. We don't need NID, but we do need the URL of the page (or any added "link" fields) to be options. We need any date fields added by a user, and the date the URL was accessed. We never need file fields. We will definitely need the node title.
Nat asks if we can architect a plugin architecture for this so that her work (and potentially the work of others) can be added without modifying the core. This way, if somebody adds a new field type, it would be automatically added.
Here's plugin work that was done for RipRap: https://github.com/digitalutsc/riprap/blob/RiprapFiles/src/Plugin/AbstractVerifyChecksumPlugin.php
Nat did a little demo on how this might work.
How to format fields flexibly - There are different ways of getting data and putting it into the array format. Discussion and Lara will move forward.
Working with the plugins but still need to put into Drupal codebase. Spending time fixing a bug. Have to account for one more case because of the way the code changed.
small code cleanup left. Needs testing with multiple end users to confirm.
Needs manual evaluation and testing.
Notes about Citation Select oddities / feature creep Settings are stored in a really unintuive way, especially for “custom” formats such as “title” and “current url”. Restructure? Explanation: Stored as a mapping of CSL fields to a list of corresponding node fields. This is to backload some processing onto when settings are set because otherwise it will need to create this list every time it’s run. “Custom” formats have custom names and the mapping didn’t seem to read properly by default or something? Add default or confirmation screen for “type” because it’s a required field. Might want to restrict it to taxonomy terms if being strict about it. It’s stored separately from the other settings but should probably be condensed with the rest Missing explicit date case for typed relations plugin Add configuration mappings (right now it’s just using the default of linked agents) for typed relations in plugin Entity references are assumed to be taxonomy terms, might want that to be more easily diversified Add export for RIS / MARC Add brief explanation of plugin development (check if need to restructure first though) Check input sanitation is good because it’s skipping security checks so that the formatting works
@ravence to cut a dev release and sync the readme into the project page.
Once the release is complete @Natkeeran will put this in playbook and core for testing
Release a module: https://www.drupal.org/project/citation_select
Can we adapt https://www.drupal.org/project/bibcite? Or is there a better module?
https://www.drupal.org/case-study/bibliography-and-citation-module-for-drupal-8 https://www.drupal.org/project/biblio