More about Views for Drupal 7 - Alternative Ways


A week ago I enabled Views for Nutshell, which I wrote about in my Drupal 7 Views & Insert Make it Look Good post. In that post I said that I was planning to use it to make the taxonomy pages look better among other things. Well, I started on that and quickly ran into big problems.

As you know, Nutshell is running on Drupal 7 with quite a few contributed modules. Drupal 7 is still in alpha and many of the modules I am using are only available in early dev versions. I took the decision to use them anyway since I wanted to really learn Drupal 7 quickly, as well as give something back to the community by testing them on a live site and feeding back any problems I found to the issue queues.

The latest problem I stumbled on was the taxonomy support in Views. It was already reported, see this issue ticket, and the developers are working on fixing it. Taxonomy is completely reworked in Drupal 7, its not only the database tables that have changed. I initially thought I would have to put this on ice until that issue is fixed.

More than one way to do it

Drupal being Drupal, you almost always have more than one way of solving a problem. When I was poking around Views for another thing, I noticed that you can filter on fields. Now when taxonomy is a field, then that field was available to filter on too.

Using the taxonomy field to filter in Views for Drupal 7

I only needed to enable the filter field and set the value to the taxonomy term ID I wanted to filter on. I realised that I couldn't use that field to use Views to override the core taxonomy, but I could use them to create topic pages.

That is exactly what I did. In the top navigation you now have three new tabs. These tabs are using the taxonomy field in Views to filter my posts based on:

  • All posts about Drupal
  • Only posts for Drupal 6
  • Only posts for Drupal 7

A nice way for you to get a filtered and good looking list of posts based on what you are interested to read about.

When taxonomy is properly working with Views I will still keep those pages, but turn them into something even better.

As said, Drupal almost always offers you multiple ways of solving problems.

Comments

Re: More about Views for Drupal 7 - Alternative Ways

Nice overviews.
They are looking really great.
I´m eager to get in touch with D7 too. But i´m not as experienced as you, so I have to wait for at least the beta version.
How did you the overviews?
There is a header text and then the list of the posts relating to the "topic".
Is it all in on view? Kind of attachment as in D6-views?

Thanks for being brave to go on board a ship with the knowledge of not knowing how many and where the holes are. And you´re not drown yet ;-)

regards
Arne
-------------------------
think and grow - get inspired

Re: More about Views for Drupal 7 - Alternative Ways

Hi Arne,

Thanks for your kind words. I have had a lot of fun working on Nutshell in Drupal 7. I now it will be a bit of a pain to get all my content, including comments, over to the beta versions since updating wont work. It has been worth it though since I have learned so much about everything new in it this way.

Regarding the headers over the views on the topic pages, they are actually just block titles. The pages itself are normal nodes of the content type Basic page that comes as standard whit D7. Then I just added the image field and enabled Insert and Image Resize Filter so I could easily add images to the body. Finally added the view blocks and configured them to only show up on one page each.

Also, you don't need to be very experienced to test Drupal 7. It is much easier to work with than Drupal 6. If you don't want to do your own installation you can always go to Drupal Gardens and create an account there.

/thomas

Re: More about Views for Drupal 7 - Alternative Ways

Thomas,
great resource in this your blog! I've worked in the past with Drupal 5; since now I have the need for an internal document repository and collaboration tool, I decided to use D7 to see what's bleeding edge. Turns out, I got hurt by the latest update, since I learned only too late that there's no migration between alphas.

It would be great if you did a write-up of the steps required to manually migrate the content, or at least do an overview with pointers to similar resources. It'll certainly save some of us that like living dangerously.

Best regards,