Use an entity reference in URL as Views Contextual Filter My site allows users to create a "booking request" node related to a "vehicle" node. I use an Entity Reference to connect the two by prepopulating a "Vehicle" field on the "booking request" node via a string in the URL:

http://example.com/vechiclename=&amp;overlay=node/add/booking%3Ffield_vehicle%3D84

I would like to display a views block on this overlaid page with more info from the related vehicle. As you can see, the NID of the vehicle is in the URL (84), but I don't know how to target it.

I'm familiar with grabbing a path component from the URL, but it's the &amp;field_vehicle=84 that is new to me. Any ideas?
I have never added a views block into the admin overlay (trying to get a parameter from the URL form the views block). But this is how I would approach the problem.

In your view, pick the 'Block' display. Add a contextual filter for the field that is referencing (Vehicle). Expand 'When the filter is not available'. Pick the option PHP Code. User the following code:

return (isset($_GET['field_vehicle'])) ? $_GET['field_vehicle'] : 'all';


I am using 'all' as fallback assuming that you will show everything if a value isn't available. But I guess you can use FALSE if you want it empty.

Save it. Add the block into your overlay/admin theme. Check if it works...

Best regards.