Well it's been a week and now I'm having fun with Drupal, but here's the problem.

A project has a contact, and a contact has a company.

So I have a 'company' content type (name and logo), and I have a 'contact' content type which has a field which is a reference to a 'company'. This works smoothly.

What I want is to be able have a computed field in 'project' that displays the 'company' of the 'contact' ... in other words I create the 'project' and select the 'contact' for that 'project' and automatically compute the 'company'. (It doesn't have to update instantly, I just need to be able to display it.)

That's the easy bit (I think). Clearly this doesn't have to be re-computed every time the node is accessed.

I have to be able to display a 'project page' and display the company name and logo on that page, along with the project's contact name.

I know how to create a custom page I'm just not sure what to put in the page to get the company name and logo.

I have a vague idea (having read up on Computed Fields for CCK) of how it might be done but I could do with some direction.

Comments

SteveTurnbull-1’s picture

Okay, I had to re-compute it for every node, not efficient but it worked.

pareen’s picture

hi SteveTurnbull,

Can you give me the recipe of the magic you did? Computed field requires the php code for calling the node reference reference field. That makes me handicapped.