Settings Pages

Settings pages are a for the most part generic admin panels. They live in the dashboard and are perfect for collecting data that doesn't make sense to be placed in a block, and doesn't need to exist in multiple instances like catalog pages. Some examples of what you may use a settings pages for would be - managing external form recipient email addresses, tax rates and shipping settings for custom shopping carts, api configuration settings, etc.

Below is an example of what a settings page for managing external form mail settings may look like.



Using the data


Unlike blocks, there is no front-end view already asssociated with the settings page data. Since Chisel doesn't know how you intend to use your data, it leave distributing it throughout your application up to you.

Along with your settings page files, a Model is generated for using this data throughout your application. Your Model file will be located in /application/src/PagePath/SettingsPageName.php.

In the mail settings example above, to pull the data into the mail settings controller - the following steps would need to be made.

First, add a use statement to the top the controller to load in the model:

use Application\src\MailSettings;

 

Next, instantiate the Model.

$mailSettings = new MailSettings();

 

Finally, call the getter method for the piece of data you wish to use. Getter methods have already been created for each field that has been added to a settings page.

$emailRecipients = $mailSettings->getEmailRecipients();