1

I've created a custom module to display in views an external database. Everything is working fine and the data are displayed right.

The problem start when I want to use contextual filter.

-I create a views block to pull data from my external database

-I add a new Contextual filter picking up the field which I want to filter (in my case "city").

  • First I get this message: "city This display does not have a source for contextual filters, so no contextual filter value will be available unless you select 'Provide default'."

  • I select "taxonomy term Id from Url", I checked "Load default filter from node page, that's good for related taxonomy blocks"

  • I checked my vocabulary which contain the terms.

If I try in "preview with contextual filter" to query with "Rome" (for example) I get all the record with Rome.

But when I attach this view block with a node wich has a taxonomy term "Rome" the record doesn't get filtered.

I've also tried "Raw value from url" to get the term from the url. Also in this way doesn't work.

When I make the same operation above using instead of external database some drupal nodes everything is working fine.

I guess the problem could be because the external database cannot comunicate with a drupal database at the same time. Maybe there is some php code to use to solve the problem ?

Thanks for your help

  • Can you establish a relationship between the two databases on the taxonomy term? – Triskelion Apr 4 '13 at 20:55
  • If I add relationship I get an empty window saying this message There are no relationships available to add. This is happening only with views calling an external database. If views instead is managing only drupal database the relationship windows has a list of field to select. – Toci Apr 5 '13 at 4:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.