Website Settings

Skip to end of metadata
Go to start of metadata

The "Website Settings" gives you the possibility to configure website-specific settings, which you can access in every controller and view.

Examples

  • ReCAPTCHA public & private key
  • Locale settings
  • Google Maps API key
  • Defaults
  • ....

Access the Settings

You can access the settings in every controller and view with $this->config. This variable contains a Zend_Config object containing your settings.

If you're not in a view or controller you can use Pimcore_Tool_Frontend::getWebsiteConfig(); to retrieve the configuration.

Example configuration

Example in a view:

<script type="text/javascript" src="http://www.google.com/jsapi?autoload=%7B%22modules%22%3A%5B%7B%22name%22%3A%22maps%22%2C%22version%22%3A%222%22%7D%5D%7D&amp;key=<?= $this->config->googleMapsKey ?>"></script>

Example in a controller:

public function testAction () {
	$recaptchaKeyPublic = $this->config->recaptchaPublic;
}

Labels

settings settings Delete
configuration configuration Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Jul 11, 2011

    Florian H. says:

    There is a bug in this settings function: If you want to write an ampersand (&am...

    There is a bug in this settings function: If you want to write an ampersand (& sign) as value, you get an error when saving. Writing the html entity (&amp;) instead, will save, but next time you go to the settings page again and change any other value (whatever) and save, you get that error again because the '&' has turned to '&' automatically...

    /edit: finally found a way to patch it:

     --- pimcore/modules/admin/controllers/SettingsController.php.old        2011-06-10 16:08:17.507495002 +0200
    +++ pimcore/modules/admin/controllers/SettingsController.php    2011-06-10 16:07:22.537494999 +0200
    @@ -1205,7 +1205,7 @@
                 $data[] = array(
                     "name" => $key,
                     "type" => $value["type"],
    -                "data" => $value["data"]
    +                "data" => htmlspecialchars($value["data"])
                 );
             }
    

    Update: Fixed in last pimcore version!