I am trying to show a gmap for a specific location, using the content: mapping coordinates for gmap in a view in drupal 7. The map itself shows fine in content for the page view, but if i clone it to block it shows all maps for that content. I cannot figure out how, without using php, to filter by the current node.

For example, node id 2 has coordinates so show the map for that node in the view for the block. and only node 2, not nodes 3,4,5,7.

I am really trying to do this using views and block and not php code in blocks.

1 Answer 1


Add an argument to the view, the argument is the node ID, then you'll be able to retrieve fields and information only for the viewed node.

Example: http://through-my-eyes.be/portfolio/events/2011/04/07/drupal-government-days-2011

  • How do you do that in drupal 7? I have looked at contextual filters and relationships, but don't see how to check against the current node. the comparison for filtering criteria also seem to be explicit. if you've done this in d7 can you export the view for the block display and paste it here, please?
    – Kim
    Aug 4, 2011 at 14:31
  • As I wrote before, create a block with a view and add an argument (Node: Nid) and extract it from URL.
    – user334
    Aug 4, 2011 at 14:32
  • That's the thing, where in d7 do you add the argument? Your example is EXACTLY what i'm trying to do, but I don't see arguments - what are they called now in d7?
    – Kim
    Aug 4, 2011 at 14:36
  • It's when you create the view. I'm not using D7 yet but the term 'argument' should be in Views 3. I'll install it tomorrow on a test instance and report back here.
    – user334
    Aug 4, 2011 at 17:10
  • Wow! Thanks! I am sure I must be overlooking something...
    – Kim
    Aug 4, 2011 at 21:32

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.