How to get the URL of a CMS page or a static block in Magento


Posted by Andrew McCombe on Wed Apr 19, 2017

Here’s how to get the URL of a CMS page or a static block in Magento.

Using the block or page Id:

<?php echo Mage::helper('cms/page')->getPageUrl( 1 ) ?>

Using the key:

In another cms block or page:

{{store _direct="url_key"}}

In a template file:

<?php echo Mage::helper('cms/page')->getPageUrl('url_key') ?>