Support » Plugins and Hacks » Zotpress » Abstract Out Zotero Sync to Custom Post Type

Abstract Out Zotero Sync to Custom Post Type

  • Just thinking out loud, but I started embarking on creating a very simple Zotero Sync plugin that would one-way sync (add/update) bib entries housed in a Custom Post Type with my Zotero account.

    User inputs Zotero collection keys, desired bib type, and presto — the plugin sets a cron to add/update a Custom Post Type on interval.

    That is it.

    The reason is to simplify front end usage, do some custom shortcoding, or even use some powerful features of Posts-to-Posts

    This will take me a few days, and as I was looking through your code, it hit me that you could likely extract out that functionality in a few hours…

    Is this something you would be able/willing to do? Or, barring that, mind if I use your plugin as a grab bag of code snippets?


Viewing 15 replies - 1 through 15 (of 16 total)
  • Plugin Author Katie


    Interesting, but not sure if I understand. So, what you’re hoping to do is have each Zotero item be a custom post type? I’m not sure what the goal in doing that would be. I’m not familiar with Posts-to-Posts, but are you aiming for a recommender system of Zotero items to regular posts or pages?

    Sort of – yes. By having each zotero item as an entry in a Custom Post Type (say “References” EG: Title: Author,Date Post: Entry, Excerpt: zotero ID ) then we can tap into all of the regular WP features: templating, tagging, categorizing, calling in the loop, etc. etc.

    Posts-2-Posts is just one way to create many-to-many relationships across all wordpress posts pages and taxonomies…

    As I understand it, Zotpress now stores data in a raw form in a separate table. For many reasons, I am trying to keep things as close to core (native) WP functionality as possible.


    Plugin Author Katie


    I suppose I didn’t imagine any of that being necessary! But I can see how it would be helpful. There’s some challenges, e.g. do we treat attachments the same as other items or do they become WordPress attachments somehow? Would there be multiple Custom Post Types? But it might be better in the end to go in that direction.

    I don’t plan on making any major changes to Zotpress in the short term, but this may be the best way to go in the long term.

    Plugin Author Katie


    Ha, I’ve changed my mind. I kept thinking about how this make so much sense. I’m working on it for the next major release.

    Nice – looking forward to seeing it.

    As proof-of-concept for a current project, I wrote a dirty function to pull a collection into a CPT and have been using Posts-2-Posts to create links.

    It has been working quite well (for this use case), I just don’t have the time build it into a publicly consumable product.

    Thanks for looking into it.

    So, I have been looking for a path to up-load the content of .ris files or a massive, endnote XML file to my WP blog and have each reference as a custom post in some Custom post type. Am I understanding that this would be the case… Is that what you are talking about? I use PODs for my other custom Post Types and taxonomies. And in Endnote, I have several custom fields. I want to export that data in those Endnote custom fields to a WP taxonomy (attached to the custom post).

    @katie, I am not a programer, but one thing I have noticed is that some plugins, don’t allow their CPT’s to be visible to other CPT plugins. (I don’t know why… it might be that they are not following best practices…) If and when you move this direction, I would appreciate it if the CPT would be visible to PODs so that I could attach a custom Taxonomy.

    Plugin Author Katie


    @hugh Absolutely, however I don’t expect to have Zotpress support direct uploads — perhaps Driftless can share their plugin with you if you’d prefer not to go through Zotero.

    At over 3000 references, going with a free Zotero account is not an option… I mean the space is too small. And if I am self hosting then it doesn’t make a bunch of sense to have the data in two places or to buy an account so I can self host.

    With regards to direct uploads, I find it interesting that no-one in the WP community has integrated Bibutils into a plugin. http://sourceforge.net/p/bibutils/home/Bibutils/

    Bibutils is used by both refbase, and the Drupal module Biblio.

    None-the-less your work here is exciting!

    Plugin Author Katie


    I wasn’t aware that Zotero had a limit on free accounts — my library is just over 2000 items but I haven’t yet encountered any difficulties.

    I hadn’t come across the Bibutils project before — it would be perfect for your case. The issue would be how to deal with two separate data sources, and so a separate plugin might be best. Wish I had more free time to make it happen. 🙂

    Is there a way to connect to a Zotero Self-hosted solution?

    Plugin Author Katie


    Not presently but that would be easy to implement as long as the API was also set up.

    Zotero doesn’t have a reference limit…it has a file storage limit (for your attachments, at 2gb last time I looked I think?) but that’s a separate issue. Zotero can sync your files to anywhere and still read them/maintain the bibliographic data on their own site.

    Well I was confused then. Thanks for the clarification. But supposedly if I have more than two 2GB of references then I would be in trouble…. but that would be a heck of a lib….

    Ah, I was wrong it’s 300mb with them. In any case I think I do have more than 2gb…it’s a hassle :-). Anyway, if you’re over their storage limit your references are still fine – so they still sync – it’s just the stored copies won’t sync online (they’ll only be on your machine) unless you specify another storage space for them, this can either be WebDav or you can pay for more space with Zotero. See http://www.zotero.org/support/sync for details

    Hi all – Interesting stuff. But with all due respect, it would be great to keep this thread on topic. Thanks!

    Katie – thanks for your work. Look forward to seeing the next iteration of Zotpress. Do you have a public repo (github?) I could check out? Happy to help it along if I can.

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Abstract Out Zotero Sync to Custom Post Type’ is closed to new replies.
Skip to toolbar