Case Study: My First View Configuration

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
indigetal's picture

In my first view that I was able to successfully configure with the help of Scott (aka spovlot) at the Drupal support forums I learned that there is usually more than one way to configure a view and it may be helpful when starting out to consider the different ways you can approach a project so you can experiment with different combinations of the possible solutions and avoid getting stuck right out of the gate. In this particular case there were 2 seemingly legitimate options for the view type and 3 possible options for exposing the filter, but after experimenting only 1 view type and 1 approach to exposing a filter was successful. It is now working exactly as required and you can view the results at: http://www.youtube.com/watch?v=2wBWBq1VYlc&feature=youtu.be.

To demonstrate this point, here is a breakdown of the exact process that I followed in order to develop the solution for this particular project:

In my first attempt I was using:

  • view type of taxonomy term
  • format set to a jump-menu listing the term name
  • contextual filter also set to the term name

Under that set up the jump menu carried over to the term pages but wasn't working properly there. The term pages were also not displaying a list of nodes associated with the term as they were supposed to. I'm thinking this had something to do with the contextual filter, which was extending the url, but when viewing the path "/term" instead of "/directory/term," the list of nodes magically re-appeared in the term pages.

In the second attempt I:

  • changed the view type to content: of my custom content type
  • set the filter criteria to "content: has taxonomy term" and exposed it
  • (It was necessary to select all of the terms in order to include them in the exposed filter)

The exposed filter also carried over to the term pages and this time was working properly, but no matter what I did I couldn't get the contextual filter to work in the url, not even when setting up a relationship with "content: has taxonomy term" and configuring the contextual filter to "taxonomy: term name" which worked under the set up of the first attempt.

The third attempt was a success:

  • The view type was kept as content
  • the filter criteria set to "content type > is one of > my content type"
  • a relationship was set to "content: taxonomy terms on nodes > my vocabulary"
  • a contextual filter was set to "taxonomy term: name > display summary > jump menu" (thereby exposing the filter)
  • the jump menu did not carry over to the term pages so a block display was created and assigned to a region within the term pages.