I'm not sure if this is possible, but I am trying to create my path prefix not be at the root.

For example:
I've got an OG space.
I want to create an OG, named "OFFICE A", giving it a PURL path of "office-a"
I want my persistent url to be at example.com/offices/office-a.
Currently, I can only create persistent paths at example.com/office-a and cannot do it at example.com/offices/office-a

Am I missing something or is this not possible?

Comments

pfrenssen’s picture

Status: Active » Fixed

I don't know if Spaces OG has implemented this, but PURL has the built-in "Pair" method that provides this exact functionality. Here is an example module that implements your use case with a very simple provider using the PURL API. Getting this in Spaces OG is a bit more complex, but this is not really the place for Spaces support, you're better off trying your luck in the Spaces issue queue.

purldemo.info:

core = 7.x
dependencies[] = "purl"
description = "Demo provider for PURL."
name = "Persistent URL demo"

purldemo.module:

/**
 * Implements hook_purl_provider().
 */
function purldemo_purl_provider() {
  $items = array();
  $items['purldemo'] = array(
    'name' => t('PURL demo'),
    'description' => t('PURL demo provider. Prints the modifier ID.'),
    'callback' => 'purldemo_callback',
    'callback arguments' => array(),
    'example' => 'foo',
  );
  return $items;
}

/**
 * PURL callback.
 */
function purldemo_callback($id) {
  drupal_set_message(t('PURL ID: @id', array('@id' => $id)));
}

To get this working for your use case:

  1. Enable the purldemo module.
  2. Go to /admin/config/search/purl/types and enable the "Path pair" type.
  3. Go to /admin/config/search/purl and choose "Path pair" for your provider, and "offices" as key.
  4. Clear the cache.
  5. Go to /offices/office-a/node.

Result: you see your modifier "office-a" output to the screen.

Status: Fixed » Closed (fixed)

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