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.
I'm wondering if its possible to have a view of equipment that are links to the reservation page, but auto populate the items list with the name of the equipment that was clicked. This way I'm first moving the users through a list of items(and descriptions) they would want to reserve as opposed to an empty form.
Comments
Comment #1
jyee CreditAttribution: jyee commentedYou can do this using the prepopulate module (https://drupal.org/project/prepopulate). Prepopulate will take a URL argument and pre-select the equipment item. The URL argument should be formatted as:
http://example.com/node/add/merci-reservation?edit[choice_wrapper][merci_reservation_items][choice_1][merci_item_nid]=1
Where the "1" at the end is the node id for the specific piece of equipment.
Comment #2
mshepherd CreditAttribution: mshepherd as a volunteer commentedThis prepopulate module solution works great!
You can also prepopulate multiple resources at once like so:
http://example.com/node/add/merci-reservation?edit[choice_wrapper][merci_reservation_items][choice_1][merci_item_nid]=NID1&edit[choice_wrapper][merci_reservation_items][choice_2][merci_item_nid]=NID2
Where you should replace NID1 and NID2 with actual NID IDs for the resources you're reserving.