Hi all,

I wanted to show results of a view depending on URL.

I explain :

I have content type named "car", with one field named "gallery".

I add a view named "view_galerie", this view must show the gallery of a car depending on URL.

Example : if the user enter the node /mysite/cars/aston-martin-db9, the view will show the gallery of the aston martin db9.

I know that i must use the views arguments to do that, but i think that i need a php snippet code.

Thanks for your precious help

Comments

manumilou’s picture

Hi,

You could try this setup for your view:

  • Add node:nid as argument
  • Choose Provide default argument in the Action to take if argument is not present section
  • Choose Node ID from URL in the Default argument type section
  • Save the view

You can then test the view by passing as argument a node ID, it should display only the images of this node.

Refer here for further information: http://drupal.org/node/344548

Manu