Mediawiki Citation export

Hello. I use Zotero and a local Mediawiki to record notes.
What I look for is a way to export in the citation with a 'back link' to my Zotero database.
The idea is to click on this link in the mediawiki page and that would open Zotero with the linked item displayed (in zotero panel, not in web snapshot).
Is there any way to to this ?
Philippe
  • edited May 25, 2011
    You'll want to use links like: zotero://select//0_ASDF1234

    This has been discussed some:
    http://forums.zotero.org/discussion/8306/testing-zoteroselect/
    But note:
    http://forums.zotero.org/discussion/17275/zoteroselect-urls-dont-always-select/

    You can get the eight-digit ID by using an export translator as discussed in the first thread, or you can get it through the server API.
  • Thanks for your answer. I will try to taylor the Wikipedia Citation script with the information mentioned in the above threads.
    But there is one problem left : Firefox (I use 4.0) won't allow Zotero:// links to be clicked for safety reasons. I saw this quoted elsewhere but I didn't find a suitable workaround.
    Maybe ther is an extension to cope with that ?
  • The underlying cause is described here: https://developer.mozilla.org/en/Debugging_a_XULRunner_Application
    And a possible fix is here: https://developer.mozilla.org/en/Chrome_Registration#contentaccessible

    Not sure if Zotero can be made to allow this-- but it'd be nice if it could.
  • (That's not actually relevant to this. That's about chrome resources registered in the manifest, but zotero:// is a custom protocol handler.)
  • And what precisely is the cause of custom protocol handlers being caught by that message?
    Security Error: Content at http://gimranov.com/research/eduard/tmp.html may not load or link to zotero://select//0_ASDF1234.

    Is this not something that Zotero can elect to override?
  • We allow access to zotero:// URLs from file URLs, but not from HTTP URLs.
  • In theory we could allow this from HTTP URLs—maybe as a hidden pref—as long as it didn't provide access to any data-modifying URLs (of which there aren't any currently). Assuming there were no security issues, I think the worst it would allow would be the possibility of some UI mischief.
  • I can imagine some nice workflows including zotero:// URLs for things in group libraries or in public user libraries-- Zotero could prompt to add the item from a public user library, or to subscribe to a group for a group library. A better option, though, would probably be to make it easy for users to get HTTP URLs for the same, and have the zotero.org server, or Zotero itself, operate on those URLs in a special way.
  • Yes, using HTTP URLs would be better. I agree that there should probably be a way to quickly view an item from the client on zotero.org.
  • edited May 26, 2011
    I did a 'quick and dirty' hack to the Wikipedia Citation template, so that the zotero:select is appended at the end of the template. Here is the code (end of script):
    ...
    // write out properties
    Zotero.write((first ? "" : "\r\n\r\n") + "{{"+type);
    for(var key in properties) {
    if(properties[key]) Zotero.write("\r\n| "+key+" = "+properties[key]);
    }
    Zotero.write("\r\n}}");
    Zotero.write(" [zotero://select//");
    var library_id = item.LibraryID ? item.LibraryID : 0;
    Zotero.write(library_id+"_"+item.key+" ");
    Zotero.write(" Z]");
    first = false;
    }
    }

    I choose to put only a "Z" for the link, because these references are already too long.

    The next step is to allow zotero: as a link in mediawiki; this is done by adding :
    $wgUrlProtocols[] = "zotero:";
    in the LocalSettings.php file of the mediawiki.
    --
    Of course, it is still not possible to click on this link, but if I right-click on it, and select:
    Zotero/Enregistrer le lien en tant que document Zotero (sorry I happen to be french)
    Bingo! The Zotero panel opens with the item selected.
    This is good enough for me, and I'm happy to this solution.
  • Glad to see this worked for you.

This is an old discussion that has not been active in a long time. Instead of commenting here, you should start a new discussion. If you think the content of this discussion is still relevant, you can link to it from your new discussion.