I need some basic content type structuring help or brainstorming

mondo - April 19, 2008 - 16:25

Content type 1: Location
This needs a name, street address, city, phone number, e-mail, description, etc. Basic stuff.

Content type 2: Event
This needs its own title, description, time, etc, but then it needs to reference the location node AND display the city from that referenced node

I have the events node working fine using events/cck date/node reference, but I can't figure out what the best way to display the city is. Does anybody have any suggestions?
I'm currently using taxonomy on the location node for the city, which is convenient but if theres a better way that would be great. I've looked at the taxonomy_node_get_terms() function but to be honest I'm not sure where to use it. Is it possible to have a CCK field populated with a php function?

Any help would be appreciated.

Look at the "computed field"

kleorn - April 19, 2008 - 19:45

Look at the "computed field" module. An alternative solution is the contemplate module IMHO.

Thank you, computed field

mondo - April 20, 2008 - 02:32

Thank you, computed field was exactly what I was looking for. Maybe. I'm not sure how to make it work at the time of form submission (I guess I don't understand drupal enough yet). If I'm using Node Reference, how do I get the referenced node's ID to use in my computed field's argument? Maybe this calls for a seperate thread subject, or more reasonably some more indepth digging by myself..

 
 

Drupal is a registered trademark of Dries Buytaert.