Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
If I set default value for name field as [current-user:name], this field filled with "Anonymous" for anonymous users. I want name field left blank for anonymous users. How can I do this?
Thanks
Comments
Comment #1
DanChadwick CreditAttribution: DanChadwick commentedThis is a token supplied by Drupal core. You can edit what user 0 is called using the Drupal configuration settings, if that helps. For example, "Visitor" might be better for you.
Or you could write your own token for this using a small custom module.
Or you could put the uid into a hidden webform component and then set a conditional IF uid = 0 then SET name to (empty). This would, however, prevent the user from filling this in, rather than just defaulting it.
Good luck.