I'm trying to set up up multiple facebook apps (with Drupal for Facebook) with one Drupal installation. After struggling with Spaces for a few days I found Sites which worked perfectly. My issue comes when I integrate with Drupal for Facebook which adds a prefix of it's own to facebook's callback url. I'm more of a web designer who knows a bit of PHP but I don't know enough to make both prefixes play nicely. My attempted workaround was to change my Sites PURL modifier from path to query string. Unfortunately sites doesn't recognize the query to activate my sites. I looked through the Sites code and couldn't find any reference to query strings so I'm assuming it's not a current feature. Any suggestions would be greatly appreciated. Awesome module BTW.
Comments
Comment #1
brynbellomy commentedWhen you say prefix, do you mean the "sites:x,y,z" prefix added to node URL paths by the Sites Path Aliasing submodule, or the actual prefix recognized by PURL (i.e. domain, subdomain, etc)?
Sites Path Aliasing is only built to deal with the prefix at the very beginning of the URL, and given the blood, sweat, and tears that went into getting it up and running, I have no plans to add other types of prefixes just yet :)
However, getting the core Sites module to work with all of PURL's prefix types is something I intend to support, and I'd be kind of surprised if it didn't work out of the box, so let me know if this is the issue you're experiencing.
Comment #2
frdesign commentedThanks for your response. I dealt with this almost a month ago so I hope I remember the details. After playing around I figured out that the issue is that Drupal for Facebook places the prefix at the very beginning of the url. As you said Sites is built to respond to the first prefix so that broke my sites functionality. I tried moving the Facebook prefix after the Sites prefix but that broke my Facebook functionality. I tried the URL Alter module which is supposed to make modules that add prefixes play nicely but it got too complicated for me.
I didn't want to give up your awesome module (and I do mean AWESOME!) so I poured through your code to figure out how it works. No easy task for me since I'm a programmer wanna be. I found the code that actually activates each site and made a custom module which used the Facebook prefix to activate my sites. It just happens that the FB prefix identifies a facebook app, which is exactly what I needed.
As far as Sites supporting PURL's other prefix types unfortunately it didn't work for me. I changed the PURL Sites modifier from prefix to Query string. Before I came up with my solution I asked the PURL developers for advice but I never got a response. (http://drupal.org/node/1055144)
PURL appends ?site=site-name to every page as expected but Sites doesn't recognize it. Not a big deal since I'm depending on the FB prefix now but for my development server the FB prefix is nonexistent. For testing environment use I ended up adding a custom function on my module which reads the query string and activates the site.
Here is the code in my module that makes things happen, probably not the best solution but it worked for me.
Comment #3
hydra commentedAs this module has not been maintained for some time, I am closing this ticket as “outdated”. A new version of sites which is architecturally and technically unrelated to the Drupal 6 and Drupa 7 versions will be published here soon.
Thank you for your contribution.