in News, Quid Pro Quo, Rails

Release 0.2 of BookmarkIt! Sidebar Plugin for Typo

Well, version 0.1 was shortlived. There was a critical difference between running with WEBrick and running in production environment with fastcgi.
The value of env[“REQUEST_URI”] did not contain “http://host”. So I found a quick solution and we’ll see if there is a better solution tomorrow.

Current solution consists of replacing

@article_url = request.env[“REQUEST_URI”]

with

@article_url = ‘http://’+request.env[“HTTP_HOST”]+
  request.env[“REQUEST_URI”]
  if @article_url.eql?(@article_url.gsub(/http:/,”).gsub(/HTTP:/,”))

You live and learn…

bookmarkit-0.2.zip and
bookmarkit-0.2.tgz

20 Comments

  1. Hi,
    I was just about to try knock together something similar when I came across your post on typeforums. I’d love to try the plugin but your download links seems to be dead!

    nem

  2. Sorry about that! I guess Capistrano got in the way here. I’ll need to find a solution.
    In any case, the files are back where they belong.

  3. Thanks a million, the plugin is excellent, just what I was looking for. I guess I’ll have to find something else for my first foray into Typo plugins :)

    nem

  4. Thanks!

    How about writing a sidebar plugin to list the most recent articles in a category, or the most recent articles in a tag?
    Or one to list the most popular articles (that one is a bit more tricky because Articles would need to keep track of impressions.
    That was next on my list, but would gladly let you take a stab at it!

  5. I just tried installing, and instead of displaying the tiny images, it displays the text in large (22px) text. Is it meant to be like this, or how can I change it to be images, as on this website?

  6. Devlin,
    when you extract the archive, it will extract everything into a directory named bookmarkit, this directory contains a _public_ directory the content of that should be copied to your own public directory. At runtime, it will expect to have the images under [root URL]/images/bookmarkit/.
    For example, here, the picture for delicious is under http://blog.nanorails.com/images/bookmarkit/delicious.gif

  7. Hi there,
    Just so that you’re informed, the plugin seems not to work with trunk. I get an infamous “Application error (Rails)” while rendering the sidebar block in the Admin panel. Rails seems to be waiting for a template config ?…

  8. Thanks for the update :)
    Unfortunately, it won’t work neither. I’d probably better upgrade my rails first…

  9. :(

    What revision of typo are you using? Typo has its won version of rails. They recently changed the sidebars, so that may be why.

  10. You’re right, it would probably not help.
    I’m using Typo 4.0.3, installed from svn trunk.
    As a matter of fact, reading through the logs won’t help, as it just tells of an “unimplemented” error :/
    I’ll try to find out what happened exactly and let you know ;)

  11. Hi, I updated the code to work with typo 4.0. Down load this tar file and unpack it into your components/plugins/sidebar directory. It’s just two files now (instead of three):

    * bookmarkit_controller.rb
    * bookmarkit/content.rhtml

    You’ll still need the images from Pascal’s original code. Happy bookmarking!

  12. Not showing up for me either – applied the 2 files above for 4.0. My version is 4.0.3.

  13. Yes – I replaced the files in the version above with the version for 4 (there were 2 of them).

  14. I see. I haven’t upgraded to the latest version. It usually is quite a bit of work with some of the custom stuff I have.

    I’ll take a look this coming week and may use a different approach like I did for the TextLinkAds plugin (which is just a basic rails plugin, and no longer a typo plugin). This will avoid breaking all the time, and be a better approach to integrate it in a post.

  15. awesome! Thanks – that totally worked, and I have them showing on individual article pages now too!

Comments are closed.