This is going to probably be a bit of a hard question to communicate clearly... I'll try.

I created a node type called "Center Data". In that node type I added a whole lot of additional fields. Those are fields that I know will always exist. I made some panel layouts, added them to a panel frame, and used that to make a page to display this information in a very pretty way. That much is working great. I also made a view to view and search all of these nodes. That was easy too.

Now.... I'm trying to figure out how to make it very easy to add contacts to this. Ideally I would have the Center Data node loaded, then give the user a little "Add Contact" button that would load (in an overlay?) a form to create that contact information. Then I want that added contact to display on the page and I'd like to have a nice and easy way to edit or delete that contact too.

I imagine that each contact will have to be a different node since there will be things like Name, Email, Phone, and so on included. I'd like to have all the contacts included in a frame so that I can easily theme it too.

I'm hoping that this makes sense. I need to do this for more than just Contacts, I have four other types of data associated with a Center Data node that I'll have to do this for. Any help will be very much appreciated. Thanks in advance!

Comments

nevets’s picture

You can use Entity Reference plus Entity Reference Prepopulate/. The entity reference field would go in the contact type. You would need to hand add a link to "Center Data" display of the form 'node/add/contact?field_center_data={nid}' where 'field_center_data is the name of your entity reference field in contact and {nid} is the node id of the center data content. Add in eva and views to display the list of contacts in "center data"

MTecknology’s picture

WOW! That took a long long time to piece it all together. But it does seem to be working. I'll just need to spend a nice chunk of time tweaking it and making it purty. Is there any chance I could make the node add form for the contact pop up in an overlay and return back to the same page? I was thinking I could add some custom link for the overlay since that seems to be how the admin links do it, but haven't figured out how to change the return to that page.

nevets’s picture

Instead of something like node/add/article try this form #overlay=node/add/article. If you are some page say node/123, I think you want node/123#overlay=node/add/article. If you are using the l() function you would want something like

print l(t('link text'), $_GET['q'], array('fragment' => 'node/add/article'));
MTecknology’s picture

And this is what ended up being my solution for this piece...
<a href="/node/add/center-contact?field_center=%node:nid&destination=/center/%node:title">Add Contact</a>

MTecknology’s picture

I can't seem to figure out how to actually make eva work. I'm gonna say that my question is fully answered here, though. I'm having trouble fitting one piece together, but I know how it's supposed to work.

Thanks!