Did you know that you can take one webform, and embed it on multiple pages? You can! But how can you find out what page the submission was made on? Well...
Method 1: it just knows
When a form is embedded into any content type (except site footer), form submissions include information about the page that was submitted to. In the screenshot following, you can see that submission 17 was done from the "Building good examples" page, and submission 18 came from "Standing ovations optional".
Method 2: it can be told
If you want to have a form in your site footer, so it appears on all pages, you'll have to add some hidden fields to tell it where the submission came from.
You can do this by adding one hidden field called "URL", and setting the default value to be the token "[current-page:url]
", and another hidden field called "page title", with the default value as the token "[current-page:title]
".
In the screenshot following, you can see that the lower submission was done from the "Building good examples" page, and the upper submission came from "Standing ovations optional".
Method 3: it can be told to be told
Maybe you don't want the form itself on the pages or in the site footer - it might be taking up a lot of space for something you don't expect people to use regularly - so you'd rather just have a button that takes you to the form.
To do this, first we'll make a couple of modifications to the form we created in method 2 - editing the URL and page title hidden fields to allow the element to be populated using query string parameters.
Next, we'll create a new "feeder form" that consists only of the submit button. In the new form, we'll remove the CAPTCHA, and edit the submit button so its label is more descriptive text (like "give page feedback", if that's what you're using the form for).
In this form's settings tab, under "submissions", we'll go to the submission purge settings, set to automatically purge both draft and completed, and retain submissions for 1 day (since this form is just a waypoint and we don't actually need this information) and save.
Next we'll go to "confirmation" and set the confirmation type to a URL. The confirmation URL should be the URL to the form from method 2, followed by ?url=[current-page:url:urlencode]&page_title=[current-page:title:urlencode]
- this tells the "method 2" form that we want to prepopulate the URL and page title fields with the information from our feeder form.
An example of a feeder form is embedded below. For this example, the URL and page title fields in the destination form are visible instead of hidden, so that you can see the information that is passed on. We've also created a separate page where you can test the feeder form, so you can see that different information is created when submitted from different sources.