Thread Rating:
  • 2 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Theme Settings
#22
(2015-12-31, 16:31:18)Arugula Wrote: Great idea for a plugin!  But question/suggestion:
     Is it possible to skip the schema? I'd like to offer the user to choose ANY color they want, rather than my small list of color combinations.   Example:  I'd use @backgroundColor in LESS, and then have a text input field in settings.php that allows user to enter in any 6-digit hex number for it that they wish.  They could get that hex number from one of many online color choosing tools.   (Although, even better, a color chooser could be incorporated into the settings.php??).

But what function/code would I need to create that text input field in settings.php to allow user to enter a color hex number?

You can specify any fields in the settings.php.
To combine extra fields specified in settings.php, but not in the *.properties (e.g. provide a template, but let the user specify the link color), use something like this:

Code:
<?php
$additional = array('f1' => return_theme_setting('f1'), 'f2' => return_theme_setting('f2'));
get_less_css('default.less', return_theme_settings($additional));
?>

If you don't have schemas, remove the schema select from settings.php and make sure you have a empty default.properties.

You could then also create the css like this (but the above code would still work):

Code:
<?php
$additional = array('f1' => return_theme_setting('f1'), 'f2' => return_theme_setting('f2'));
get_less_css('default.less', $additional);
?>
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply


Messages In This Thread
Theme Settings - by mvlcek - 2014-07-12, 08:34:42
RE: Theme Settings - by shawn_a - 2014-07-12, 08:51:27
RE: Theme Settings - by Carlos - 2014-07-12, 17:32:34
RE: Theme Settings - by mvlcek - 2014-07-12, 18:22:34
RE: Theme Settings - by Tzvook - 2014-07-15, 20:47:06
RE: Theme Settings - by Tzvook - 2014-07-15, 21:50:44
RE: Theme Settings - by Tzvook - 2014-07-15, 22:33:26
RE: Theme Settings - by Oleg06 - 2014-07-13, 05:25:31
RE: Theme Settings - by Oleg06 - 2014-07-15, 23:13:45
RE: Theme Settings - by Tzvook - 2014-07-15, 23:22:20
RE: Theme Settings - by Oleg06 - 2014-07-15, 23:34:09
RE: Theme Settings - by Tzvook - 2014-07-15, 23:40:01
RE: Theme Settings - by Tzvook - 2014-07-30, 02:34:35
RE: Theme Settings - by mvlcek - 2014-07-30, 02:49:59
RE: Theme Settings - by Tzvook - 2014-07-30, 03:04:02
RE: Theme Settings - by mvlcek - 2014-07-31, 15:19:23
RE: Theme Settings - by Tzvook - 2014-07-31, 06:12:49
RE: Theme Settings - by Oleg06 - 2014-07-16, 00:36:17
RE: Theme Settings - by Oleg06 - 2015-04-08, 19:58:34
RE: Theme Settings - by mvlcek - 2015-04-09, 06:12:22
RE: Theme Settings - by Arugula - 2015-12-31, 16:31:18
RE: Theme Settings - by mvlcek - 2015-12-31, 23:02:12
RE: Theme Settings - by Arugula - 2016-01-01, 10:23:45
RE: Theme Settings - by mvlcek - 2016-01-01, 20:03:16
RE: Theme Settings - by Arugula - 2016-01-02, 15:56:20
Multi-lang: Theme Settings - by Tzvook - 2016-02-13, 04:28:21
RE: Theme Settings - by mvlcek - 2016-02-15, 02:16:41
RE: Theme Settings - by Timbow - 2016-10-13, 08:04:27
RE: Theme Settings - by DrogoNevets - 2016-10-14, 14:29:33
RE: Theme Settings - by Oleg06 - 2019-11-15, 00:27:47



Users browsing this thread: 1 Guest(s)