I just discovered you can use pre-populate module to select a contact category in a Drupal contact form.
For instance, if you have 3 categories for your contact form and want to pass an url to pre-select category 3, just pass ?edit[cid]=3 in your link, e.g. http://yourdomain.com/contact?edit[cid]=3.
Nice.
Comments
07/25/08 @ 13:06
Thanks for sharing this! I was bummed to find out that anonymous users cannot access personal contact forms. While I understand the underlying concern here, I still need a way to allow anonymous users to submit messages to registered users.
Since my site doesn't have many users, it won't be difficult to create a category per user and use this technique :)
07/25/08 @ 13:38
See also: http://drupal.org/project/advcontact
07/25/08 @ 14:21
@cpugeniusmv: I saw that in the Drupal thread. I already use Prepopulate though, so this solution served me well.
07/25/08 @ 16:29
Thanks for the hint! Here is the link to the module page: http://drupal.org/project/prepopulate
07/25/08 @ 17:26
Is this working for you with both Drupal 5 or 6? As far as I know, there are a few outstanding issues to have this work with Drupal 5:
http://drupal.org/node/101916
07/25/08 @ 18:05
I'm still using Drupal 5 on all of my sites.
08/04/08 @ 20:07
I wasn't able to get this to work with a Drupal 5.8 install :(
08/05/08 @ 06:09
Chad: How are you forming your URLs?
08/09/08 @ 18:57
Short urls. The specific link file relative and is "contact?edit[cid]=4".
08/10/08 @ 07:01
Wierd. And it's still not working, huh? Sorry, but I'm not sure why it's not.
08/10/08 @ 11:38
Nope, still not working. Here's the full link http://indiesf.com/contact?edit[cid]=4.
Oh well. There aren't too many categories on that contact form :)
08/10/08 @ 14:33
And Prepopulate module is on?
09/05/08 @ 10:02
You can also use the contact_forms module that enables a separate contact form page for ech category. This will allow you to specify the following urls for the categories you have set up for the contact form: /contact/general for general, /contact/feedback for feedback, /contact/special for special. Basically it creates a contact form for each category set up which does not have the category drop down. Plus, /contact still works and will display the dropdown for a generic contact form where the users can choose.
Post new comment