In the latest dev, there's been some code ripped out of template.php and put into page.tpl.php. The code should define the path to the themed logo, but up until now it hasn't been working.

Instead of moving the code to page.tpl.php, it should be fixed -- and remain -- in template.php. This section of code in template.php:

if (theme_get_setting('litejazz_themelogo'))
{
   function _phptemplate_variables($hook, $variables = array()) {
     $variables['logo'] = base_path() . path_to_theme() . '/images/' . theme_get_setting('litejazz_style') . '/logo.png';

     return $variables;
   }
}

needs to be changed to:

function litejazz_preprocess_page(&$variables) {
  if (theme_get_setting('litejazz_themelogo')) {
    $variables['logo'] = base_path() . path_to_theme() . '/images/' . theme_get_setting('litejazz_style') . '/logo.png';
  }
}

Then revert the changes you made for displaying the themed logo in page.tpl.php.

While you're at it, Alyx, you might think about changing this code (also in template.php):

if (is_null(theme_get_setting('litejazz_style'))) {
  global $theme_key;
  // Save default theme settings
  $defaults = array(
    'litejazz_style' => 0,
    'litejazz_width' => 0,
    'litejazz_fixedwidth' => '850',
    'litejazz_breadcrumb' => 0,
    'litejazz_iepngfix' => 0,
    'litejazz_themelogo' => 0,
    'litejazz_fontfamily' => 0,
    'litejazz_customfont' => '',
    'litejazz_uselocalcontent' => 0,
    'litejazz_localcontentfile' => '',
    'litejazz_leftsidebarwidth' => '210',
    'litejazz_rightsidebarwidth' => '210',
    'litejazz_suckerfish' => 0,
    'litejazz_usecustomlogosize' => 0,
    'litejazz_logowidth' => '100',
    'litejazz_logoheight' => '100',
    'litejazz_banner' => 1,
  );

  variable_set(
    str_replace('/', '_', 'theme_'. $theme_key .'_settings'),
    array_merge(theme_get_settings($theme_key), $defaults)
  );
  // Force refresh of Drupal internals
  theme_get_setting('', TRUE);
}

function get_litejazz_style() {
  $style = theme_get_setting('litejazz_style');
  if (!$style) {
    $style = 'blue';
  }
  if (isset($_COOKIE["litejazzstyle"])) {
    $style = $_COOKIE["litejazzstyle"];
  }
  return $style;
}

$style = get_litejazz_style();
drupal_add_css(drupal_get_path('theme', 'litejazz') . '/css/' . $style . '.css', 'theme');

to

$style = theme_get_setting('litejazz_style');
if (is_null($style)) {
  global $theme_key;
  // Save default theme settings
  $defaults = array(
    'litejazz_style' => 0,
    'litejazz_width' => 0,
    'litejazz_fixedwidth' => '850',
    'litejazz_breadcrumb' => 0,
    'litejazz_iepngfix' => 0,
    'litejazz_themelogo' => 0,
    'litejazz_fontfamily' => 0,
    'litejazz_customfont' => '',
    'litejazz_uselocalcontent' => 0,
    'litejazz_localcontentfile' => '',
    'litejazz_leftsidebarwidth' => '210',
    'litejazz_rightsidebarwidth' => '210',
    'litejazz_suckerfish' => 0,
    'litejazz_usecustomlogosize' => 0,
    'litejazz_logowidth' => '100',
    'litejazz_logoheight' => '100',
    'litejazz_banner' => 1,
  );

  variable_set(
    str_replace('/', '_', 'theme_'. $theme_key .'_settings'),
    array_merge(theme_get_settings($theme_key), $defaults)
  );
  // Force refresh of Drupal internals
  theme_get_setting('', TRUE);
}

drupal_add_css(drupal_get_path('theme', 'litejazz') . '/css/' . $style . '.css', 'theme');

That removes the unnecessary function (you may have noticed that the litejazzstyle cookie is never set).

Comments

kisugiai’s picture

well look at the pickstyle function in this function is a cookie necesseary

you can try out
add a block on front its recoment only front with

<a href="/" onclick="pickstyle('blue')">Blue</a>
<a href="/" onclick="pickstyle('green')">Green</a>
<a href="/" onclick="pickstyle('red')">Red</a>

an the first part looks good let me check this out if this work

mrtoner’s picture

Ah, you're right. I didn't know about that bit of Javascript -- and I still don't know why it's in a production theme. It only seems to be there in order to demo it on RoopleTheme.com.

kisugiai’s picture

hm, i am not sure some user want have an another color mybe is this a little solution for it
but i can make it as feture so thats you can it swich on and off in the settings. let me see or waht do you think about.

mrtoner’s picture

Well, it only seems useful to be able to allow a visitor to the site to change the color on-the-fly. (Which is how it's used on the demo site.) For a production site, there's already a setting to set the style in the theme configuration and there is no UI exposed to the user to allow for changing the style. As I see it, you have three options:

- Add a block with the links to change the color on-the-fly. Developers can enable the block if they desire. I think this needlessly complicates the theme and it appears it was never intended for any site other than RoopleTheme.com.

- Remove the code (as above) and pickstyle.js. Also the line in page.tpl.php that adds pickstyle.js to the document. My preferred solution and I don't think anyone will notice.

- Leave as-is. You may have users ask about it in the future.

kisugiai’s picture

Status: Active » Needs review

i have made pickstyle switchable
the logo function are back to template.php

mrtoner’s picture

Seems to work just fine, just a minor grammatical error. The new option, "Enables StylePicker JS" should be "Enable StylePicker JS" or "Enable StylePicker JavaScript". Speaking of labeling changes, I've never cared for the "Include Local Content File" and "Local Content File Name" labels -- what the heck is a "local content file"? Those should be "Include Custom Stylesheet" and "Path to Custom Stylesheet" to better identify the options.

kisugiai’s picture

okay done ;)

mrtoner’s picture

Status: Needs review » Fixed

You da man!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

Spelling error