Magento: How can I display backend config settings in frontend CMS pages (or static blocks)?

Magento: How can I display backend config settings in frontend CMS pages (or static blocks)?

September 28, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento: How can I display backend config settings in frontend CMS pages (or static blocks)?

Displaying Magento Backend Config Settings in Frontend CMS Pages

In Magento, backend configuration settings are used to define store-specific parameters like shipping rates, tax classes, and payment methods. As a developer, you may find it necessary to display these configuration values in the frontend for your clients to edit easily via CMS pages or static blocks. Fortunately, Magento provides convenient ways to access and use these configurations.

Understanding Magento Configuration

Magento stores its configuration settings in the database under the core_config_data table. Each setting is identified by a unique path (e.g., carriers/flatrate/price). You can retrieve any of these values from your frontend code using Magento’s built-in functions.

Pulling Config Variables in PHP Code

To access configuration variables in your PHP code, you can use the Mage::getStoreConfig() function provided by the core Mage class. Here’s a basic example:

<?php

// Get the shipping rate price for the Flat Rate carrier
$flatRatePrice = Mage::getStoreConfig('carriers/flatrate/price');

// Output it in the frontend
echo "Flat Rate Shipping: $" . $flatRatePrice;

Remember to include the file Mage.php at the top of your PHP script if you’re not calling this function from an Magento action file.

Using {{ }} Brackets for Config Variables

If you want to display these variables directly in a CMS page or static block, you can use Magento’s template language syntax. Here are two methods:

  1. Using {{config path="carriers/flatrate/price"}} Syntax:

You can embed the config value using the direct {{ }} brackets with the path attribute. This works seamlessly within CMS page content or static block content.

<h2>Our Shipping Rates</h2>
<p>Flat Rate: {{config path="carriers/flatrate/price"}}</p>
  1. Using PHP Code in Templates:

If you need more complex logic, you can include a PHP file containing the config retrieval code within your template.

<div id="shipping-rates">
  <?php echo $this->getChildHtml('cms_block'); ?>
</div>

Then create a new block type (e.g., cms_block) in your layout XML:

<block type="core/template" name="cms_block" template="path/to/your phpfile.phtml"/>

In the PHP file, you can use functions like Mage::getStoreConfig() to retrieve and output configuration values.

Security Considerations

Ensure that any config variables displayed in the frontend are properly validated and sanitized. Never output raw database values without checking their integrity.

Keep your Magento installation secure by following best practices from Laravel Company.

Conclusion

Displaying backend configuration settings in the Magento frontend is a common requirement for many e-commerce projects. By utilizing Magento’s built-in functions and template language, you can easily retrieve these values and integrate them into CMS pages or static blocks. This allows your clients to manage their store configurations more efficiently without needing technical PHP knowledge.

Remember to stay updated with Laravel Company for the latest Magento tips, tricks, and best practices to boost your development productivity.

Database Themes Admin Configuration

Our network