By trevorleenc on
What I would have now, is a link on a node, that goes directly to the author's personal contact form.
I was wondering if there is a way to have the node title passed to the contact form's subject field as an argument or something like that?
Comments
nothing ? :(
nothing ? :(
I believe I have something
Since I am a newbie to Drupal, those who are experts please forgive my naive work. I was on the right track, it seems. The way Drupal passes variables from one 'page' or 'view' to another is through arguments that are delimited by the '/' symbol and parsed into an array called 'arg' for use later. For the page I was working with did this, at least.
So, let us say that you have a page that you want to pass an argument to from another page's hyperlink. It works like so...
On the referring page, your anchor tag would include something like :
<a href=http://www.mysite.com/drupal/q=node/myVariableToPass1/>click me</a>Then on the page where your want to do something with the variable, you'd call it up from its position in the array like so:
<?php echo arg(0); ?> // Will echo node <?php echo arg(1); ?> // Will echo the value of myVariableToPass1 as a literal stringNow, I don't know exactly how drupal will handle complex strings with non-alphanumeric characters, but the urlencode() function of php should be able to encode string text in such a way as to return the string in the next page correctly wht urldecode().
Hopefully, someone will find this enlightening, but since I have very little advanced Drupal development knowledge at this point, I could be doing this incorrectly. However, I have used this method on my site and it seems to be working properly so far.
bumping...with a bit more
bumping...with a bit more details...
so I have some "classified ads" setup...and I have a link on each ad that goes to that author's personal contact form...
What I'd like to have is if someone clicks that contact link, it will send the node title to the personal contact form's "subject" input field.
is this even remotely possible? if so, where would I start
Bumping..with a bit more
I have been working on a similar issue myself. It appears from my research that this is probably done by using an arg() function for Views. I have yet to work out the particulars on this, but I think that I'm on to something here with parsing the arguments which follow the node portion of the url.
check this
I suck at going back and posting when I did find my own solution...
anyway...
check this out: http://drupal.org/project/advcontact
this is the link I create for the node (using node.tpl.php)
on top of that, you can specify category's as well when linking to the site contact form, which is cool, because somewhere on your site you might say, click here to contact sales, and the contact form will have your "sales" contact form category...cool huh!
How can I do that in Drupal
How can I do that in Drupal 7?
If I use '&subject=anything' I get a Page not found error.
Hi, Advcontact is not yet in
Hi,
Advcontact is not yet in Drupal 7, see request: https://drupal.org/node/2016031
greetings, Martijn
use the webform module
I now use webform to create all my contact pages. And it can accept GET arguments and such.
Without having to use
Without having to use Webforms is this achievable yet with the core Contact Form?
Passing the subject in the link still doesn't work. I tried to urlencode the title too.
Thanks