Output saved addresses to a node

julianna - August 31, 2009 - 01:03

I want to allow users to:
1. save several addresses (in whatever format or with any module---I'm open to options)
2. when creating a new node type (e.g. story, page, etc), select from a list of the saved addresses
3. have the selected address output in the created node

I've tried a few different options, but they don't result in what I want. Can anyone think of a more streamlined solution than these?

Failed Option 1
1. Install CCK
2. Install Addresses and allow for addresses in profiles
3. Create a new field for my Story node with User Reference type to reference the user
Result: I can reference the user with the address, but all that outputs is a link to the user. What I want is the full profile, or the address portion of the profile to actually output into the node (without having to go to another node).

Failed Option 2
1. Install CCK
2. Create a node type Address
3. Create an Address node
4. Create a new field for the Story node with Node Reference to reference the Address node type
Result: Same as above, but it links to the node instead of showing the actual node content.

Failed Option 3
1. Install CCK
2. Install Addresses and activate Addresses CCK
3. Create a new field type for the Story node with Address as the field type.
Result: Addresses can be added in full to the node, but has to be manually added each time. Clicking the "default" option doesn't save the address for future use.

Failed Option 4
1. Install Viewfield
2. Create a node type Address
3. Create a view type Address with:
Filters = Node Type = Address; User = Active
Fields = Title; Body
Result: Address can be shown, but I can't figure out how to (a) allow for the person creating the node to select from a list of addresses and (b) output the address selected by the user, not output an address linked to the viewer (which is what happened with the filter User = Active)

The closest I can come to a workaround is to use Addresses and activate Addresses CCK, then use Node Clone so that users can "save" nodes with addresses populated and clone them for each actual node they want to create.

Create an address content

antoniotorres - August 31, 2009 - 06:15

Create an address content type and enter your addresses in the title, no body is necessary.
use CCK Node Reference to select the address.
Configure the field as needed.
Theme as needed.

It's kind of straight forward and simple.

Formatting

julianna - August 31, 2009 - 10:30

Hi, Antonio.

Thanks! I didn't think of doing it that way. But wouldn't the address will be one line? Or would I be able to override that with theming?. Most of the addresses provided have the following information:

Institution Name
123 Main St
City, Province/State
Tel: 555-555-5555 x 123
Fax: 666-666-6666
www.institution.com
contact@institution.com

 
 

Drupal is a registered trademark of Dries Buytaert.