I'm developing several Facebook apps that share the same functionality, basically a bunch of subsites. I'm trying to use the Sites module, Drupal for Facebook and PURL. Everything works great until I test my apps through the facebook app iframe which requires a prefix of it's own.

So this works great:
(base url)/(purl prefix)/(regular drupal path)

But these don't:
(base url)/(purl prefix)/(facebook prefix)/(regular drupal path)
(base url)/(facebook prefix)/(purl prefix)/(regular drupal path)

I've been trying for days to get this to work but no dice. I even downloaded the URL Alter module which is supposed to fix issues related to using PURL and Drupal for Facebook together. I at least got Drupal to recognize both as prefixes so arg(0) is what it's supposed to be but the PURL prefix gets ignored by sites and it's not appended to the page's links. I'm more of a designer who knows enough PHP to get by so I hit a dead end with this approach.

My next bright idea, or so I thought, was to change the PURL method Sites uses to activate each of my sites from Path to Query String so I could do the following:

(base url)/(facebook prefix)/(regular drupal path)?(modifier key)=(site name)

Purl appends the query to all my page links as expected but Sites is not recognizing the modifier.

I looked through the code on Sites and this is how they use hook_url_provider

<?php
/**
 * Implementation of hook_purl_provider().
 */
function sites_purl_provider() {
  $items = array();
  $items['sites'] = array(
    'name' => 'Sites module',
    'description' => t('Sets a context based on PURL modifier.'),
    'callback' => 'sites_purl_set_current_site',
    'callback arguments' => NULL,
    'example' => 'somesite',
  );
  return $items;
}
?>

These are my PURL settings:
Provider: Sites module
Sets a context based on PURL modifier.
Modifier type: Query String
Key: mysite

Which automatically sets modifiers as:
Provider: Sites module
Modifier: mysite
ID: (empty)
Method: Query string

Is there anything I need to change so Sites recognizes the query string? It worked great with the Path method until the FB prefix complicated things. Thanks in advance for any input.

Comments

socialnicheguru’s picture

have you found an answer to this?

frdesign’s picture

See post for the workaround I came up with.
http://drupal.org/node/1053350