Creating a package
Permalink
I have just created a block that I'm quite pleased with but there are some things that I don't know how to do and can't really find tuts for.
First thing is that I want to create a package of it which I managed to to, but, I want to have a settings page on the dashboard with one option really. I got the single page there but how do I proceed?
I want to be able to get the option value from my block easily, I also want to be able to edit the value in settings.
is that clear?
should I use db's or something else, Help please.
First thing is that I want to create a package of it which I managed to to, but, I want to have a settings page on the dashboard with one option really. I got the single page there but how do I proceed?
I want to be able to get the option value from my block easily, I also want to be able to edit the value in settings.
is that clear?
should I use db's or something else, Help please.
Sounds like what I'm looking for, how do I solve it in the controller codevize?
$pkg = Package::getByHandle('my_package_handle'); $pkg->saveConfig('MY_CONFIG_SYMBOL', $data ); $data = $pkg->config('MY_CONFIG_SYMBOL');
(The convention seems to be that config symbols are uppercase)
You can use php serialize/unserialize or json to store more complex data structures.
Use phpMyAdmin to browse the database Config table and get some ideas.
http://www.concrete5.org/documentation/developers/system/config-pre...
Your dashboard single page will need a controller and a view. The controller can use the config for storing/retrieving the settings.
Your block controller then read config to find out how it is configured.