views:

17

answers:

1

Summary:

I'm currently working on customizing Drupal-6 as a news portal.

In summary, I'm trying to view posts that belong to term 5 AND term 1.

The drupal documentation mentions that this can be achieved through the below taxonomy URL by separating the term ids with a comma (,):

http://drupal-server/taxonomy/term/5,1

(See. Using Vocabularies for Navigation: http://drupal.org/node/22273)

The above is not working as expected and is showing content with "term 5 OR term 1" instead of "term 5 AND term 1".

Any ideas on how to fix this?

Problem Details:

I have defined two vocabularies:

  1. "Content" vocabulary which has the terms:

    a. Events

    b. News

    c. Lectures

  2. "Academy" vocabulary:

    a. University A

    b. University B

    c. University C

Every time an article is posted, it is assigned a term indicating which university does it relate to, and whether it is an Event, News or Lecture.

I'm trying to display the posts that are of type "Lecture" AND "University A".

According to the Drupal documentation, this can be achieved using the URL:

/taxonomy/term/5,1

Assuming "University A" got assigned the term ID 5 and the "Lecture" got assigned term id 1. The documentation mentions that the comma separator (,) works as an AND operator and thus displaying only posts that relate to term 5 'and' term 1.

Unfortunately, this is not working as expected, it is showing me the posts that relate to term 5 OR posts that relate to term 1.

Is this a Drupal bug? Any ideas on how to force an AND? I've even tried replacing the comma with the "+" operator but with no luck (ie. /taxonomy/term/5+1).

A: 

Okay, I've got an answer for this:

First of all, this is a bug that already exists in Drupal with the Views Module installed as you can see from this link:

ht tp://drupal.org/node/348360

So, you have to choices to fix this problem:

  1. Either disable the taxonomy_term view that is by default enabled in the views module. From the administration go to Administer --> Site Building --> Views then scroll down till you find the taxonomy_term view and click on the Disable Link next to it.

  2. Or create a view with arguments. See the following link for information on how to do that: http://gotdrupal.com/videos/drupal-views-arguments

Basil Musa