It is useful sometimes to have links on the fb canvas page that link to off of the canvas page but to a page on the same site that is hosting the canvas page.

But currently an ylink (that use url) gets rewritten my fb module, so that it says on facebook. would it be possible to listen for a option that says the link is leaving the canvas page, and if so to not so a rewrite?

CommentFileSizeAuthor
#4 fb_url_alter.diff3.01 KBDave Cohen
#1 fb-931660.patch571 bytese2thex

Comments

e2thex’s picture

StatusFileSize
new571 bytes

I have attach a patch

Dave Cohen’s picture

Status: Active » Needs review

In the past, I've done this by calling fb_scrub_urls() after the call to url() or l(). But your idea here is better!

I don't like the option name 'off_canvas'. It would have to start with 'fb_...' to clearly belong to the namespace of modules/fb. I'm thinking 'fb_url_no_alter' (in D7, it will be called url altering instead of url rewriting.

My one concern is passing a module-specific option through drupal's core url() and l() functions. Although I personally am in favor of this change, I pinged development@drupal.org about it and I hope to see comments before checking this in.

agentrickard’s picture

This should not affect other modules using the custom_url_alter() hook(s). AFAIK, url() itself doesn't care what options values are passed in, so as long as you aren't clobbering a core $options key, this should be fine.

Dave Cohen’s picture

StatusFileSize
new3.01 KB

Here's the patch I'm now considering. Introduces two $options...

if $options['fb_url_alter'] === FALSE, links will be out of canvas pages, to the main website. On canvas pages, this should only be used in conjunction with $options['absolute'] = TRUE.

if $options['fb_canvas'] == TRUE, links will be to canvas pages. That is, will generate an absolute url starting with http://apps.facebook.com/...

e2thex’s picture

Cool I testing the patch from #4 with the fb_url_alter and it worked well (patched beta1)

Dave Cohen’s picture

Status: Needs review » Fixed

Changes checked in for next release.

Thanks guys.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Exploratus’s picture

Is in the latest release??? I dont see the option.

I really need the links on the Facebook App to link to my Drupal site.

It used to do this with 2.0 but now with 3 it doesnt.