Question

Hello everyone.

Here is my problem. I have a photo gallery content type in which i store several photos.
One of my fields is a list field(named 'period') with 3 options (2000-2004, 2004-2008, 2008-2012), refers to the period the photos was taken.

Now i want to make a main menu link(ex. path: /photos/2004-2008) which leads to a page
with a view. That view is gonna take the '2004-2008' variable from the url and use it as a filter creteria. This way the view results would be the photos with 'period' field value = 2008 -2012.

Can plz someone help me? I am very confused..

First problem, What is the correct path for the link in main menu?

Second, What is the correct path for my panel page (i use panels module) which contain my view.

Third, how to set properly my view to do this task?

Was it helpful?

Solution

For your approach Drupal has 'Contextual filters'. So you have to pass the url parameter and need to specify that which argument you want to catch. So if it's argument 0, 1 or 2 ( %1, %2 etc ) then that data will be collected and processed.

You can also assign your custom php code for the custom functionality. Please check with the screen shot. It's really pretty easy! enter image description here

Let me know, this helps you!

Keep Drupalizing :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top