Using the Profile2 module, how to access contextual information to place a views block on profile page?
Using the View Default Argument From Context Module I added this code to it.

function views_arg_context_profile2_view($entity, $view_mode, $langcode) {
  context_set('user', 'uid', $entity-&gt;uid);
  context_set('profile', 'pid', $entity-&gt;pid);
}


Now there is an option in Views Default Argument to pull the ID from context and I place either user or profile in the appropriate text field and it works fine.