Hi,
Thanks for this great module! Just thought it would be nice to add a [parent-path] token that contains the parents URL that for example can be used by the pathauto.module in the child content types to build the child's URL. I just added:


line 1321:
$values['parent-path'] = $parent->path;
line 1376:
$values['parent-path'] = '';
line 1413:
$tokens['relativity']['parent-path'] = t("Parent node URL path");

and voila, it worked. I would create a patch for review if I only would know how ...
If this functionality is already in the module and I overlooked it, please let me know.

Greetings,
Marco

Comments

michelle’s picture

This sounds great, but didn't work for me. $parent->path is empty at line 1321.

Michelle

jhedstrom’s picture

I'm doing something similar, and use this line around 1321 (sorry I can't submit a patch, but the version I'm developing on is a bit out of whack with HEAD at this point, and I think the patch wouldn't apply properly).

     // Parent path
      if ($parent->path) {
        $values['parent-path']         = $parent->path;
      }
      else {
        $values['parent-path']         = '';
      }