Settings allow you to store small pieces of information that live in one place and are easily editable. You can use these settings for a multitude of functions, including phone numbers and addresses, Google Analytics account numbers and even lists of custom navigation items outside of the typical page structure.
To access a setting in a template, use $cms->getSetting()
. For example, if you work at a university that enrolls 2538 students, you can store that number as a setting called enrollment_total
and retrieve it by calling $cms->getSetting("enrollment_total")
.
You can also request several settings at one time with $cms->getSettings()
by passing it an array of items to retrieve:
$settings = $cms->getSettings(array("address","phone_number","email_address"))