Creating a complex view

fgasking - June 26, 2008 - 21:25

I currently have two content types: "Newspaper history" and "Cartoonist biography".

Within the Newspaper History type, I wanted to associate cartoonists who worked on that newspaper and derrive the link from the Cartoonist biographies created, so I added a nodereference field in the Newspaper History type called ASSOCIATED_CARTOONIST which allows you to reference Cartoonist biography titles and accepts multiple values.

With this in place, I wanted to reverse things on the Cartoonist Biography pages and list all Newspaper history pages which are linked to that cartoonist (via the Title field of that content type).

I decided that the best way would be to create a view which essentially does this...

SELECT TITLE
FROM NEWSPAPER_HISTORY
WHERE NEWSPAPER_HISTORY.ASSOCIATED_CARTOONIST = CARTOONIST_BIOGRAPHY.TITLE

However, although I can select the ASSOCIATED_CARTOONIST field in the Filters section, I cannot say that the value must be equal to the current Cartoonist biography title.

Am I right in thinking that I have to do this all via Arguements instead of the filter?... Or maybe will I have to build this view completely via code rather than by interface?

In Drupal 5 you could do

marcvangend - June 26, 2008 - 22:45

In Drupal 5 you could do something like this with the backlinks module. For D6, backlinks is integrated with the Views module. As it says on the Backlinks project page: "On Drupal 6 simply install the Views module and enable the backlinks view, or create your own using the "Search: Links to" argument." I'm afraid that's all I can tell you, because I do not have D6 & Views2 installed yet.

Thanks very much, i'll take

fgasking - June 27, 2008 - 08:21

Thanks very much, i'll take a look into this.

I have also been trying to find out how to get an RSS feed for each of my View's, but I don't think this is supported yet unfortunately with Views 2.

This worked a treat!... One

fgasking - June 30, 2008 - 15:10

This worked a treat!... One problem is that unfortunately I have to run the cron each time I want the backlinks to show up.

Is there any way of this being automatic upon linking?

The very idea of cron is

marcvangend - June 30, 2008 - 16:53

The very idea of cron is just that: you have to set up your server so it runs automatically. If your webserver does not offer this option, use the poormanscron module.

No worries, that should be

fgasking - July 2, 2008 - 14:02

No worries, that should be fine. I'll make a note to set this up once the proper server arrives.

 
 

Drupal is a registered trademark of Dries Buytaert.