How contextual filters work in the Views module can you can explain with simple example

Comments

jaffaralia’s picture

Contextual filters are the way of receiving the argument from the URL.

for example:

  • We created page view. The views result should be based on the argument passed on the URL. The callback URL is http://localhost/drupal7_1/testservice/1001
  • first argument is testservice
  • second argument is 1001. The 1001 is the NID
  • Now the second argument NID is keep changing like (1001, 1002, 1003). Based on the second argument(NID) the view result will change. We can achieve the above scenario by using views contextual filters

You can check below links for further details URL: https://www.drupal.org/node/1578558