Hi All,
I am a newbee to Drupal and I like to extend Node Reference URL widget capabilities. The README.txt mentions how to Build your own links and this is my goal. I like to pass in 3 additional parameters in the URL and autopopulate the correct fields.
However, I am unsure where to alter the code. Is it in the nodereference_url.module or do I have to create a node_contenttype.tpl.php to add the code.

I just need to be pointed in the right direction so I am not circling myself.
Thank you for your time and efforts.

RSR

Comments

quicksketch’s picture

You should never, ever modify a module's code directly (unless you plan on submitting your changes back to the original project as a patch). Modifying modules directly makes it impossible to upgrade to newer versions of modules, which may contain security fixes in addition to just normal bug fixes and features.

The code described in README.txt is intended to be used either in your own custom modules or (more likely) in tpl.php files. Putting it in node-[type].tpl.php files is definitely common and would probably be the right location.

Radhi’s picture

Thanks for your reply.

Here is a bit of background:
We have a Job Type and Job Application Type. The Job Application Type is using Node Reference URL from Job Type. The value passes in Job Id (as expected). I also want it to pass in three additional parameters; i.e. CCK fields Supervisor, Position, and Department and set their fields in a similar way Job ID is (the Node Reference URL Id).
My question is where/how would I set the fields for the additional parameters.
I am trying Node Form Template to help modify the form to set the fields based off of your suggestion with node-[type].tpl.php however, not sure where to put the customizable code to read in the fields from the node reference url.

In addition, if the Node Form Template route does not work, I am thinking of extending Node Reference URL to create another module. In which hook in Node Reference URL.module returns the form of the Job Application Type?

Thanks for your help - I really appreciate your time and efforts.
Best,
RSR