[OJS 3.1.1-1] How to add abstract field to a custom Citation Format (CSL)?

Hi, I have a question regarding the CSL plugin in OJS:
So far, we have succesfully added new citation styles to OJS with the plugin by @GrazingScientist GitHub - GrazingScientist/CitationPlugin: An example to include your custom citation style into OJS 3 . Now we would like to expand a specific citation style to also include the abstract field from article landing pages. We already tried using the variable “abstract” but had no success. Is there a simple way to include the abstract field in a CSL-file?

Hi @ojsbsb,

Thanks for letting us know. The abstract is a valid CSL property, so we should be passing it. But it looks like we aren’t. I’ve fixed this now and it will go out with the next minor version (3.2).

If you’d like to use this in the meantime, you can see the code you need to change here:

Changing the file should be safe, since the change will be included in the next version. However, if you don’t want to modify the file, you can use the hook to load custom data into the citation before it is compiled:

1 Like

Hi @NateWr,
thanks for your fast reply. This is exactly what I was looking for. I’ll implement your changes to our OJS installation.

My OJS is on version 3.1.1.4
I am on branch 1.0.0 (locales)

Hi, I tried to add a new locale file in /ojs/plugins/generic/citationTestStyleLanguage/lib/vendor/citation-style-language/locales/ locales-es-CA.xml to translate in catalan language, but it’s not working.

I have as well
/ojs/plugins/generic/citationTestStyleLanguage/locale/es_CA with my locale modified.

I used:

HookRegistry::call('CitationTestStyleLanguage::citation', array(&$citationData, &$citationStyle, $article, $issue, $journal));

I would like to add a new String with data: [Online dd-mm-yyyy] to the end of citation and i would like with different languages.

Any help ?

Regards,
xavi.