Release 0.2 of BookmarkIt! Sidebar Plugin for Typo

Posted on Thu Mar 09 18:13:00 UTC 2006

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

Posted in News, Quid Pro Quo, Rails  |  Tags , , ,  |  20 comments

Comments

  1. nemonoid nemonoid said // Mar 22, 2006 at 09:56 AM

    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. Pascal Pascal said // Mar 22, 2006 at 11:00 AM

    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. nemonoid nemonoid said // Mar 22, 2006 at 11:23 AM

    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. Pascal Pascal said // Mar 22, 2006 at 02:22 PM

    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. Devlin Palmer Devlin Palmer said // Jun 04, 2006 at 07:47 AM

    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. Pascal Pascal said // Jun 04, 2006 at 12:21 PM

    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. tanguy:r tanguy:r said // Sep 12, 2006 at 07:33 PM

    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. Pascal Pascal said // Sep 13, 2006 at 02:24 AM

    Tanguy, did you try the version attached to [Upgraded to typo 4](http://blog.nanorails.com/articles/2006/08/08/upgraded-to-typo-4-0)

  9. tanguy:r tanguy:r said // Sep 13, 2006 at 06:56 AM

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

  10. Pascal Pascal said // Sep 13, 2006 at 07:30 AM

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

  11. tanguy:r tanguy:r said // Sep 13, 2006 at 10:29 PM

    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 ;)

  12. Joe Rosenblum Joe Rosenblum said // Sep 15, 2006 at 05:04 AM

    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!

  13. Pascal Pascal said // Sep 15, 2006 at 07:02 AM

    Excellent, Joe. Thank you! Chris, you should try Joe's version.

  14. Jesse Jesse said // Dec 15, 2006 at 12:29 PM

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

  15. Pascal Pascal said // Dec 16, 2006 at 07:26 AM

    Jesse, did you try the [version for 4.0](http://blog.nanorails.com/articles/2006/08/08/upgraded-to-typo-4-0)

  16. Jesse Jesse said // Dec 17, 2006 at 10:05 AM

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

  17. Pascal Pascal said // Dec 17, 2006 at 10:28 AM

    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.

  18. Pascal Pascal said // Dec 18, 2006 at 03:19 PM

    Jesse, there is new (and improved) version of the plugin. Chec it out in this [new post](http://blog.nanorails.com/articles/2006/12/18/bookmark-it-rails-plugin-for-adding-bookmarklets)

  19. Jesse Jesse said // Dec 18, 2006 at 04:00 PM

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

  20. Pascal Pascal said // Dec 18, 2006 at 04:10 PM

    :) you are welcome

(leave url/email »)

Comment Markup Help