I’m afraid that’s not possible. Since the form is in a widget, it is part of the WordPress loop and is not aware of the page title or content.
Oh that’s a shame thanks for the reply Jeremy – and the education, I didn’t realise that was the case.
Can I do it manually by adding code to each widgitised version of the contact form or will the plugins settings overrule the HTML I add?
<INPUT TYPE="hidden" NAME="subject" VALUE="Your Subject">
Thanks again and for all the work you put into the plugin and its support.
I can’t think of any work around, unfortunately. As long as the shortcode is in a widget, I can’t think of any way you’d be able to collect information about the page you’re on.
Sorry Jeremy, I probably wasn’t very clear.
I use Widget Logic to make widgets appear on certain pages so I can create say 5 different Jetpack contacts forms across 5 different pages. I guess what I’m trying to get at is if I hardcode the widgetised contact form that appears on “Page 1” as…
<INPUT TYPE="hidden" NAME="subject" VALUE="This Came From Page 1">
…will the contact form be sent with that subject or will Jetpack’s default/specified Subject take precedence/dominance over that?
Oh right. Widget Logic (or Jetpack’s Widget Visibility module) is a nice workaround.
You can define custom subjects for each contact form thanks to the subject parameter, like so (note the subject='custom subject' parameter in the shortcode):
[contact-form subject='custom subject'][contact-field label='Name' type='name' required='1'/][contact-field label='Email' type='email' required='1'/][contact-field label='Website' type='url'/][contact-field label='Comment' type='textarea' required='1'/][/contact-form]
Ah thank you Jeremy, you are a living legend and a prince amongst men.
I wasn’t aware of Jetpack’s Widget Visibility module, I can’t keep up with everything being added – I need to sit down and take the time to have a closer look.