Posted By

metareason on 03/20/08


drupal 9l

Versions (?)

Who likes this?

2 people have marked this snippet as a favorite


Views argument handling code: get gid from pretty group path

 / Published in: PHP


Add this arg code plus set first argument as "OG: Group nid(s)"

  1. // get the node id for the group
  2. // expecting site urls to be in format group/group-name
  3. // HACK: get the internal (source) url from the first part of the path with arg, expecting to find 'group/group-name'
  4. $group_url = drupal_lookup_path('source', 'group/'.$args[0]);
  5. // extract the group node id
  6. $group_url_exploded = explode('/', $group_url);
  7. $args[0] = $group_url_exploded[1];
  9. return $args;

Report this snippet  

You need to login to post a comment.