I use the CCK to ensure that an image is displayed with each post (on my site, most posts are game reviews, and these images are screenshots).

When this content goes through Drupal for Facebook, the images do not get displayed. I believe this is because:

  1. CCK is using base_url or something of the kind to determine the full path.
  2. Drupal for Facebook is rewriting base URLs to apps.facebook.com/myapp/, but this means the resulting IMG tag is pointing locally to facebook instead of to the site's actual URL, which is where the images are hosted.
  3. Voila, nothing shows up -- the IMG tag is in the page source, but pointing to facebook, of course.

Shouldn't Drupal for Facebook be set up only to rewrite URLs for Anchors? I'd think anything else should continue to point to the hosting site...

Comments

Dave Cohen’s picture

Drupal for Facebook changes the global base_url, all URLs that are computed with it, or the l() and url() functions, are affected. This may not be ideal, but every other approach I can think of also has problems. I'm certainly open to other possibilities if you have ideas.

I'm not familiar with CCK Image Fields, but I suspect they use a theme function to render the image tag. If so it could be overridden in fb_fbml and the img src could be calculated differently. You're right that all image src attributes (and other URLs to files) should not be re-written to start with apps.facebook.com/,,, however I'm not sure how to do it. Maybe a patch to core is required.

costik’s picture

Yep... rewriting the base URL would do it. IIRC, CCK doesn't use a theme function, per se, to do this, but a themable function, anyway, which I could over-write. I imagine a lot of modules use $GLOBALS['base_url'], though, which may make it tough to have module compatibility with Drupal for Facebook.

emarchak’s picture

Version: 5.x-1.x-dev » 6.x-3.0-rc14

I'm having the same issue with 3.0-rc14. I'm surprised that this hasn't been addressed yet.

I'm currently tackling this issue, and will post my findings. Any support that could be offered would be much appreciated.

emarchak’s picture

I ended up finding a solution and posted it at #1213500: Imagecache Image URIs not appearing on Canvas Pages. The issue was with additional text added to the uri in the path.

Dave Cohen’s picture