1

I have multiple nodes of type 'schools'

I also have a contact form that i'd like to provide on a per school basis.

I.e. The user views a school page and can use an entityform embedded or linked to that particular schools page to generate a pdf letter to mail to the school. This letter will be pre-populated with the School name, School address, Head Mistress and other fields from the 'schools' content type that it came from.

I have set up 'entity reference' and 'entityreference prepopulate' as per this tutorial and have made some headway.

However I can so far only successfully pass one item from the node to my form using url arguments ... how can I pass multiple arguments ~5-6 elegantly to prepopulate my entity form?

I am open to alternative approaches, it would be nice to have the form embedded on the schools page...rather than linked (via the block in the above example)

2

You can follow the same approach given in the example.

You will need to rewrite the link from

http://example.com/contactform?field_name=12345

to

http://example.com/contactform?field_name=12345&field_name_second=4567&field_name_third=890

This should do the trick for you.

If you want it to look more elegant, then you can just pass the entity id of the referring object and then write some code to pre-populate the values based on the given entity.

  • 1
    Thanks Gokul, This does answer my question and I will mark it as such. – iain maitland Jun 23 '14 at 14:17
  • What would the code look like and where would I need to put it? Thanks – iain maitland Jun 27 '14 at 19:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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