It would be great if the _phptempate_variables call contained the if statement for the themed logo instead of vice versa. As it is now it makes it confusing for new users to add code to the _phptemplate_variables function. The following is a sample (with advanced forum contained for an extra bonus if it is installed.

function _phptemplate_variables($hook, $variables = array()) {
  if (module_exists('advanced_forum')) {
    $vars = advanced_forum_addvars($hook, $vars);
  }
  if (theme_get_setting('tapestry_themelogo')) {
    $styled_logo = '/images/' . get_tapestry_style() . '/logo.png';
    $variables['logo'] = base_path() . drupal_get_path('theme', 'tapestry') . $styled_logo;
  }
  return $variables;
}

Comments

roopletheme’s picture

Assigned: Unassigned » roopletheme

Agreed (although you've mixed $vars and $variables in your example). I actually have this code in my latest sandbox copy:

function _phptemplate_variables($hook, $vars) {
  $vars = array();
  if (module_exists('advanced_profile')) {
    $vars = advanced_profile_addvars($hook, $vars);
  }
  if (module_exists('advanced_forum')) {
    $vars = advanced_forum_addvars($hook, $vars);
  }
  if ($hook == 'page') {
    if (module_exists('page_title')) {
      $vars['head_title'] = page_title_page_get_title();
    }
  }
  if (theme_get_setting('tapestry_themelogo')) {
    $vars['logo'] = base_path() . path_to_theme() . '/images/' . theme_get_setting('tapestry_style') . '/logo.png';
  }
  return $vars;
}

I'll commit it as soon as I wrap up a few other changes that have been requested.

excell’s picture

Ah - Thank you! after a while of trying to figure things out I found this post via Google search :) and fixed my own problem according to your data here! Rock and roll Roopletheme, tapestry & Advforum (just making sure those keywords are in)

summit’s picture

Hi,
Are these changes committed on Drupal 5 please?
Thanks a lot in advance for this.

greetings,
Martijn

roopletheme’s picture

Not yet. I've been working on re-writes of litejazz and newsflash (which do have these changes committed), and I haven't made my way to tapestry yet. I will do so soon, but there are a number of other changes that I want to commit as well (update the theme for 6.x Block Theme module support, etc.) I will do so as soon as I can, but it will probably be after my pending vacation.

summit’s picture

Hi,
Thanks for the update and a good vacation for you!
greetings,
Martijn

kisugiai’s picture

Status: Active » Closed (fixed)

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