1

I have a page that displays nodes of awards. These awards have taxonomy Year added to them. The url to them is : url.com/aboutus/awards. I have a block view created that pulls the awards and I've set a contextual filter that filters the awards by year.

When I type in a URL such as url.com/aboutus/awards/2013, I want only the 2013 awards to be listed. I've been trying to accomplish this with a dynamic field but the argument isn't passing.

Does anyone have any idea how I can solve this? (I am a newbie to Drupal, so apologies if my vocabulary isn't completely accurate.)

2 Answers 2

1

Views comes with a (initially disabled) page that will display your taxonomy terms for you. If you look for "Taxonomy Term" in your views overview you should find it. It will display all of your taxonomy terms through a view.

It is recommended that you enable the view, clone it, disable the original and work with the clone, to begin with. However, be careful as it will turn all your taxonomy terms into a views page.

0

You simply follow the following steps in order to make it work.

enter image description here

Now add your dynamic field value say i.e year and pass the argument value as shown below.

enter image description here

4
  • The problem is the default page uses no value from url, it's simply url.com/aboutus/awards. When I want to filter a year, I want to have the third argument, url.com/aboutus/awards/2013. This doesn't seem to work using your method. :(
    – Sheryl
    Commented Jun 10, 2015 at 14:36
  • I'm still not clear about your question. As per your question you want year as a parameter but from your comment it seems you don't want to pass argument in URL. If you want to fulfill both cases using single view then choose PHP option in contextual filter and pass the argument after applying your logic through PHP code. If this is exactly your requirement then I can share PHP code with you otherwise please provide some more context of your problem with some examples or screenshot. Commented Jun 11, 2015 at 9:56
  • Sorry for the confusion. Basically, the site is set up so url.com/aboutus/awards loads awards from all years. We want to keep that up, but ALSO have the option to pass a year parameter to filter by year. I think your PHP code may help, but I don't see a PHP option in contextual filter - only content, numeric, taxonomy term, or user. Thank you!
    – Sheryl
    Commented Jun 11, 2015 at 18:55
  • To get PHP option in contextual filter, you should enable Views-PHP module for this. Commented Jun 12, 2015 at 5:57

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.