Creating Static Content
Adding static content to the front office is straightforward with Ector Configurator. The system makes all configurations available within the relevant Controller via the Smarty variable $ec_content
.
Example: Adding a Logo to the Footer
Let's say you want to add a logo to the Footer. To do this, simply go to the All
Controller and add a new configuration.
Step 1: Add the Configuration
Add the following configuration to the All
Controller:
{
"All": {
"footer_logo": {
"width": "150",
"height": "150",
"src": "https://via.placeholder.com/150"
}
}
}
Step 2: Modify the Footer Template
Once the configuration is saved, open the footer.tpl
file and add the logo with the following code:
<img src="{$ec_content.footer_logo.src}" width="{$ec_content.footer_logo.width}" height="{$ec_content.footer_logo.height}" alt="Footer Logo">
Implementation Details
- Smarty Variable
$ec_content
: This variable contains all configurations passed by the controller. In our case, theAll
Controller passes the logo configuration to the footer. - JSON Configuration: All configurations are nested within the JSON managed by
Ector Configurator
. This centralized approach allows for easy management of theme changes and customizations.
Advantages of the Approach
- Centralization: All configurations are centrally managed via
Ector Configurator
, making updates and maintenance easy. - Flexibility: Configurations can be easily modified and updated without directly altering theme files.
- Efficiency: Ector's caching system ensures that configurations are quickly available without recalculating payloads at runtime.
Conclusion
With Ector Configurator, adding static content to your site's front office is a simple and straightforward process. By using the Smarty variable $ec_content
and configuring the appropriate Controllers, you can easily customize your theme and maintain centralized control over all site configurations.