I'm building a conference registration site in Drupal 8. I've set up a register link for a custom user role that includes a query string (
/register?reg-id=custom-id) and would like to pass this value (
custom-id) back to a hidden field when my form is displayed to my user so that I can have users that are of the same role but with varying
reg-id depending what they signed up for.
Ideally I would like to set it up using the user fields available under account settings and not through the template settings as more than one template may be used in the future (on a per conference basis). Alternatively a module might work, but I can't seem to find a starting point for this in Drupal 8. As a side note the
custom-id is generated from a taxonomy term field on the referring page - just in case there an option to feed the form the variable another way.
I have looked at the following, and numerous others, but they don't quite meet the requirements for my use case:
How to retrieve GET parameter in Twig template
https://www.drupal.org/project/userreference_url (seems ideal but not ported to D8)
How do I pass a value from the url to a custom field in the registration form? (for D7)
Any assistance would be greatly appreciated.