Skip to main content
replaced http://magento.stackexchange.com/ with https://magento.stackexchange.com/
Source Link

While there are some dynamic variables that you can use in the CMS, it's not possible to get user information without custom code.

If you embed your form in a phtml template instead of a CMS page, you can include this template in the CMS:

{{block type="core/template" template="your/form.phtml"}}

In the template, you can use any PHP code like

$customer = Mage::getSingleton('customer/session')->getCustomer();
$firstname = $customer->getFirstname();

It would be best practice to move this code to a block class. Note that you can specify the block type as well, so instead of core/template you can use any other block.

But either way, you have to add the block type to the block whitelist in "System > Permissions > Blocks" to be able to use it in the CMS (see: http://magento.stackexchange.com/a/87897/243https://magento.stackexchange.com/a/87897/243)

While there are some dynamic variables that you can use in the CMS, it's not possible to get user information without custom code.

If you embed your form in a phtml template instead of a CMS page, you can include this template in the CMS:

{{block type="core/template" template="your/form.phtml"}}

In the template, you can use any PHP code like

$customer = Mage::getSingleton('customer/session')->getCustomer();
$firstname = $customer->getFirstname();

It would be best practice to move this code to a block class. Note that you can specify the block type as well, so instead of core/template you can use any other block.

But either way, you have to add the block type to the block whitelist in "System > Permissions > Blocks" to be able to use it in the CMS (see: http://magento.stackexchange.com/a/87897/243)

While there are some dynamic variables that you can use in the CMS, it's not possible to get user information without custom code.

If you embed your form in a phtml template instead of a CMS page, you can include this template in the CMS:

{{block type="core/template" template="your/form.phtml"}}

In the template, you can use any PHP code like

$customer = Mage::getSingleton('customer/session')->getCustomer();
$firstname = $customer->getFirstname();

It would be best practice to move this code to a block class. Note that you can specify the block type as well, so instead of core/template you can use any other block.

But either way, you have to add the block type to the block whitelist in "System > Permissions > Blocks" to be able to use it in the CMS (see: https://magento.stackexchange.com/a/87897/243)

Source Link
Fabian Schmengler
  • 66.1k
  • 25
  • 188
  • 422

While there are some dynamic variables that you can use in the CMS, it's not possible to get user information without custom code.

If you embed your form in a phtml template instead of a CMS page, you can include this template in the CMS:

{{block type="core/template" template="your/form.phtml"}}

In the template, you can use any PHP code like

$customer = Mage::getSingleton('customer/session')->getCustomer();
$firstname = $customer->getFirstname();

It would be best practice to move this code to a block class. Note that you can specify the block type as well, so instead of core/template you can use any other block.

But either way, you have to add the block type to the block whitelist in "System > Permissions > Blocks" to be able to use it in the CMS (see: http://magento.stackexchange.com/a/87897/243)