6

Magento 1.9

I am trying to add a form several times onto a CMS page with code similar to:

{{block type="core/template" template="page/html/jobappform.phtml"}}

But I want to pass a variable thru to the PHP in jobappform.phtml so I can differentiate between the different forms.

I have tried using:

{{block type="core/template" template="page/html/jobappform.phtml?a=1&b=2"}}

In the hope I get get at the variables with $_GET, but if I use this the form doesn't appear.

Is there a way of doing this:

{{block type="core/template" template="page/html/jobappform.phtml" a="1" b="2"}}

And then in jobappform.phtml can I get at variables a and b?

6

You can definitely use the code you pasted:

{{block type="core/template" template="page/html/jobappform.phtml" a="1" b="2"}}

And then in your template you can do:

$this->getA(); 
$this->getB();

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.