Theme Development - Theme Options
Permalink
Hey,
Wondering if you guys got any idea how to create a "Theme Options" page similar to the one that c5hub did with their Fundamental theme ( See here:http://fundamental.c5hub.com/features/theme-options... )
Would like to further improve my C5 Theme development with something like that. Didn't find any documentation about it so decided to ask you guys.
Any help is appreciated.
Best Regards,
David
Wondering if you guys got any idea how to create a "Theme Options" page similar to the one that c5hub did with their Fundamental theme ( See here:http://fundamental.c5hub.com/features/theme-options... )
Would like to further improve my C5 Theme development with something like that. Didn't find any documentation about it so decided to ask you guys.
Any help is appreciated.
Best Regards,
David
I've done a very similar thing and RGE is spot on for the way I did it.
Config::save.... ends up writing the values you pass into the nodes you specify in
/application/config/generated_overrides/concrete.php
below is a sample from options I have added:
The good news is there is a shortcut - to test things out you don't need to build a package right away.
You can manually add config items to that file and access them in your theme like so:
$fullWidth = config::get('concrete.theme_options.full_width');
$title = Config::get('concrete.title');
$menu = Config::get('concrete.theme_options.menu');
For example I use $fullWidth to switch my theme quickly between a full screen layout or boxed layout.
Config::save.... ends up writing the values you pass into the nodes you specify in
/application/config/generated_overrides/concrete.php
below is a sample from options I have added:
The good news is there is a shortcut - to test things out you don't need to build a package right away.
You can manually add config items to that file and access them in your theme like so:
$fullWidth = config::get('concrete.theme_options.full_width');
$title = Config::get('concrete.title');
$menu = Config::get('concrete.theme_options.menu');
For example I use $fullWidth to switch my theme quickly between a full screen layout or boxed layout.
Appreciate the quick & detailed replies guys. Going to have a look at it now.
When the form is submitted the data is received in the controller action method. The information than can be stored in a Config object.
for example:
later in the theme or controller they can check the config settings
For creating a package you can read the documentation. The config part is not in there.