In pathauto module settings I have


for all group types. I have few group types: Ex Technology, Arts, Design etc and within each group type you can create as many groups as you want.

So when I create a group named google, the path looks like this :



I want to have any article created within that group and to have a path like this




How to achieve something like this? I could not find any token replacement pattern for my use case in pathauto module. Is there some trick here?


4 Answers 4


I tried:


Worked like a charm.

So, I guess that you should go with:


Note: Posted the answer since this was the first result on Google (for me), and no answer was given... Perhaps it will put someone else in the right direction faster.


[node:og-group-ref]/[node:title] is what worked for me.

  • Note that [node:og-group-ref] will result in a URL chunk based on the actual name of the group. This can differ from the group's URL alias if you configured a manual alias there. If you want the group's URL alias, the answer by @Marcus Farrington points into the right direction ...
    – tanius
    Sep 19, 2014 at 14:45

this isn't a complete answer as I only have one group type ("projects"), but within admin/config/search/path/patterns I use


for each of the different content types, unless I want the url to display a different term than that of the content type. I believe this would cover the


part of your string. Presumably you'd just put your


in place of my "projects," unless [node:group_group] produces "technology/google," in which case go with


  • Thanks, however [node:group_group] is not recognizable when the path is for a group content type. That is, an article path in pathauto doesnot recognize [node:group_group]. And that is how it is suppose to be. I could hardcode something like you said technologies/[node:group_audience]/[node:content-type]/[node:title], but in that case I have to create article content type for each group type. And thats a bummer.
    – Minty
    Jul 13, 2012 at 12:17

For me, this worked:

  1. Install sandbox module og_token.

  2. Apply patch og_token-og_7.2-1930132-1.patch to og_token, as per Drupal issue #1930132 comment 1.

  3. Optionally, if you want the tokens to use the group's URL alias rather than group title: in file og_token.module, exchange function og_token_get_group_labels() with this:

    function og_token_get_group_labels($nodes, $options) {
      $labels = array();
      $sanitize = !empty($options['sanitize']);
      foreach ($nodes as $group) {
        $label = drupal_get_path_alias('node/' . $group->nid);
        $labels[] = $sanitize ? check_plain($label) : $label;
      return $labels;
  4. Set your pathauto pattern to:


This solution is based on lahode's work. It achieves the same effect as the answer by @Marcus Farrington to this very question, which for me does not work with the latest versions of modules og, token etc..

All these problems with OG tokens are discussed at length in Drupal issue #1088538.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.