Is it possible to do something like prepopulate with popups api add and reference?

We have a piece of content we want to collect where we would like a couple taxonomy fields to be filled in.

Haven't even tried yet, just seeing if anyone has examples or advice.

best,

ben, agaric

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tpainton’s picture

Any luck with this? I want to do the same thing. Have no idea how to use prepopulate with this and since I can't get to the url, not sure I can. One option I have not tried yet is to see if nodereference_url would work or be modifiable??

This would be a great feature.

greg.harvey’s picture

Component: Code » User interface
Category: support » feature

Me too - will take a look.

greg.harvey’s picture

I suspect a good approach will be to save the current data in a cookie with JavaScript when the Add link is clicked and then use it in a 'prepare' op in hook_nodeapi() for the target content type.

greg.harvey’s picture

Version: 6.x-2.0-alpha1 » 6.x-1.0
Status: Active » Needs review
FileSize
6.41 KB

Ok, here's an experimental patch which adds the ability to pass taxonomy to child (referenced) nodes. After applying, please check the README. Instructions are important. It depends on jquery_plugin and the Jookie plugin for saving the taxonomy data in a cookie via JavaScript.

It works for me, but it's against the 6.x-1.x branch.

greg.harvey’s picture

Status: Needs review » Needs work

Actually, this seemed to work for me at first, but it's not working now! I'll have to revisit later in the week. Will post a new patch when I get it working reliably. Probably on Friday.

greg.harvey’s picture

Status: Needs work » Needs review
FileSize
8.18 KB

New patch attached. It still needs work, but it does all my client needs. It's a good starting point, so setting to needs review. After applying the patch, please see the updated README for the todo list and other bits. Feedback needed, help required to finish this.

montesde’s picture

I need this functionality too but to prepopulate nodereference fields. If we had the ability to make custom node/add URLS or be able to add some queries or anchors to the end of url, it would make this more flexible.

I'm trying to make a popup node reference field that autopopulates the node that is added and then fills in the original field while using the prepopulate module.

- John