Filter View based on current user profile info (from Content Profile Module) I have the Content Profile module installed. With this module, each user has 1 to many locations that are attached to them. 

These locations are created via a content type called locs.

I have another content type called todays_spot that also has a selectable location (only one) also being dynamically created via locs.

So I'm pulling some of the todays_spot data out via a view, but I need to filter it so it only displays data if the user location(s) match. 

Any suggestions, I've looked all over and can't find a thing.
See this post for a solution in Drupal 7, but the same principle applies here.

Create an argument for the related loc of todays_spot.
Choose the the right relationship (node, I think), and select 'provide default argument'
Use 'PHP Code' as your default argument

You'll need to modify the code below to match your system, but it should resemble the following:

global $user;
// the code below loads via the Profile2 module, but something similar
// will work with Content Profile, but you'll need to inspect the code
// to find a function similar to `profile2_load_by_user`
// I'd start by inspecting the $user variable with print_r or dd();
$profile = profile2_load_by_user($user-&gt;uid,'facilitator');
if (!$profile) { return ''; }
if (!isset($profile-&gt;field_location['und'])) { return ''; }
$locations='';
foreach ($profile-&gt;field_location['und'] as $location) {
  $locations.=','.$location['nid'];
}
return substr($locations,1);


Don't forget to select 'Allow Multiple Terms Per Argument' before saving your new argument.