Can I trigger the zotero connectors from a webpage?

Hi all!

I am working on a publication website (open source for open science). I'll post its first journal website URL as soon as it is released here with the hope to gather some feedback from the community/

I already exposed the metadata of the articles so that it can be saved by the Zotero connector without any issue.

However, I would like to make a citation oriented feature where you not only add the reference but also the text you selected as a citation (under the "notes" tab is the best approach I found so far). Think of it as a medium style website based on Zotero for the storage of notes/references & identification.

The process would be as follows:
- You select some text from the article
- a contextual menu pops out with a Zotero button
- you click on it
- it triggers the same as if you clicked on the connector button but with the selected text as a note in the metadata somehow.

As far as I know, it implies doing 2 things I'm not sure I can do:
- Trigger the connector from the webpage
- Add a note in addition to the original metadata (I can edit it as I see fit but I'm not sure that adding notes is exposed by the connector metadata parser.)

Is it possible? I had a quick look at the documentation but couldn't find relevant info. Let me know if I missed something.

Thanks!
  • You could take a look at how OSF implements this for their preprint servers, eg:

    https://psyarxiv.com/k9mn3
    https://github.com/CenterForOpenScience/ember-osf-preprints

    You might also look at running citation-js on your server, which can take structured metadata and format using CSL styles.
  • I don't think sample citations is what they're after?
    I think the idea is to add to Zotero with a note based on selected text. I'm pretty sure that's not currently possible, but might be worth re-considering given the new note editor in Zotero 6
  • Sorry if I misunderstood
  • edited January 18, 2022
    Zotero has a "Create Zotero Item and Note from Selection" option if you select some text on a website and right-click — that sounds to be more or less exactly what @billybobbonnet is asking for. This wouldn't be something triggered on the website itself, but that's the same as with all saving to Zotero — Zotero users are used to (or should be used to) using the browser extension rather than the kinds of tool-specific export buttons that appear on various database/catalog sites.

    When Zotero ran entirely within Firefox there used to also be a way to add additional selected text to a selected note in Zotero. There are some technical challenges doing that now given browser extension restrictions, but we're hoping to bring it back in the future. For now, you'd have to copy additional text and paste it into the note as a blockquote.
  • Thank you all for the answers!

    @dstillman Thanks a lot for the info. It looks like it could do the trick with the native contextual menu :-)
Sign In or Register to comment.