I created custom block with webform. Client needs several webforms on the same page, all do the same thing - send emails to client. But he needs ability to control what text is on submit button, like “Send inquiry”, “Contact us”.
I tried solution, which comes in mind first: I added field in block, where client can write button text. But getting errors “Can’t use method return value in write context” or “Block error: “Call to a member function name() on null” in block type: “contactform””. Is there any way to do this?
If you want to pass variables to a snippet that is included in your block snippet, then you have to pass those variables down, like you do in other contexts:
snippet('some-snippet', [ /*array of variables*/ ])