1

I'm trying to do a theme-settings.php, and I have it as far as I can tell exactly the same as everything I have ever seen on any page tutorial about this. But some reason it's not working, which means I'm missing something.

thinkrium.info

    name = Thinkrium
description = Thinkrium theme.
core=7.x

regions[content]      = Thinkrium Content
regions[left_nav_bar] = Thinkrium Main Navigation
regions[footer]       = Thinkrium Footer
regions[header]       = Thinkrium Header

stylesheets[all][] = css/style.css
stylesheets[all][] = css/overlay.css

scripts[] = js/left_nav_bar.js
scripts[] = js/overlay.js

settings[hidden_text_color]   = #0000ff
settings[hidden_background_color]  = #000000

Here's theme-settings.php

$form['hidden_text_color'] = array(
    '#type' => 'hidden',
    "#attributes" => array('id' => 'hidden_text_color'),
    '#default_value' => theme_get_setting('hidden_text_color'),
);

$form['hidden_background_color'] = array(
    '#type' => 'hidden',
    "#attributes" => array('id' => 'hidden_background_color'),            
    '#default_value' => theme_get_setting('hidden_background_color'),
);

I am getting nothing at all.

halfer
  • 19,824
  • 17
  • 99
  • 186
thomedy
  • 93
  • 11
  • Do you have cleared the Drupal cache? (admin/config/development/performance) – Syscall Mar 26 '18 at 10:14
  • try to load it manually like explain in answered question : https://drupal.stackexchange.com/questions/91067/how-to-set-theme-setting – Fky Mar 26 '18 at 12:03

1 Answers1

0

You need to ask for your variables in you template file (for example page.tpl.php). It should be something like this:

if (theme_get_setting('hidden_background_color')): ?>
  //Do whatever you want.
endif;

if (theme_get_setting('hidden_text_color')): ?>
   //Do whatever you want.
endif;
Daniela
  • 454
  • 3
  • 9
  • I wanted this to work so bad... I even cleared the cache again for the 10th time... returns empty... I even ran it as an if statement just in case im misinterpreting the return.... which I did read the source code in the docs but it hit the else in stead... im going to try that other comment...I – thomedy Mar 28 '18 at 05:43