I have a bunch of webforms in blocks on taxonomy pages. It would be helpful for the recipient of the resulting emails to know what taxonomy page the user was on at the time they wrote their query. Do I use the %get token in a hidden field? And if so then what [key] value returns the full (pathauto) url? Webforms can only use %get[key] and %post[key] for non-authenticated users.


4 Answers 4


You can achieve this by using the %server token as the value of the hidden field. To be more precise http://%server[SERVER_NAME]%server[REQUEST_URI] should get you the full url (path alias is also preserved). For a complete list of options that can be used with the %server token check out the manual.


The %server token only works for authenticated users since Webform version 2.8 due to potential security/privacy issues with some values. Since you only need the url in e-mails a better solution should actually be to put a appropriately themed version of <?php print url($_GET['q'], array('absolute' => TRUE)); ?> inside your copy of webform-mail.tpl.php file (or webform-mail-[node id here].tpl.php).

  • 1
    Webforms can only use the %server token for authenticated users... Only admins are authenticated on this site. Reopened question.
    – Kirk Twist
    Commented Feb 16, 2012 at 3:23
  • @KirkTwist You're right. I managed to miss this important detail. Updated my answer accordingly.
    – Madis
    Commented Feb 16, 2012 at 19:56

You can simply use the yoursite.com/%get[q] this token is for drupal's special request parameter which holds the current path

  • This is a great workaround for the previous issue of the %server token not working for anonymous visitors. Tested, works great. Thanks! Commented May 8, 2013 at 14:58

If you are working with Drupal 7 + Webform 7.x-3.18 you can add a Hidden field to your webform.

Then in the hidden type you can choose the option "Secure value (allows use of all tokens)"

This allows you to use all tokens types, like %server[SERVER_NAME] or %server[REQUEST_URI]

Tested with anonymous users and working fine.


When I required token support for my webforms I used the webform patched module. It's the webform module already patched to support tokens. So you could use in your hidden field the token [current-page:url]. I have not tried this in a block webform but I do not see a reason it should not work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.