theme_settings.php drupal默认设置

时间:2018-03-26 07:47:20

标签: drupal drupal-7 custom-theme

我正在尝试做一个theme-settings.php  而且我已经拥有它,就我所见过的任何关于此的任何页面教程的内容完全相同...但是有些原因它不起作用......这意味着我错过了一些愚蠢的......

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

好吧,一个继承人

主题的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'),
);
没什么......什么都没有

我很难过......请帮忙

1 个答案:

答案 0 :(得分:0)

您需要在模板文件中询问变量(例如page.tpl.php)。它应该是这样的:

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

if (theme_get_setting('hidden_text_color')): ?>
   //Do whatever you want.
endif;
相关问题