I don't know if this a symptom of a larger issue but when I first create my site I have to actually go to the theme's configuration page for the show-on-focus class to be added to the skip-link div. This, despite the default setting for skip navigation display being set to focus.

How can I ensure this works without requiring the site owner to configure the theme?

Comments

Jeff Burnz’s picture

You can't, its just the way it works - you must visit the theme settings page at least once and save the settings.

eft’s picture

Jeff, I don't even have to save the settings for the change to take place. So there must be some code that is run when I simply navigate to the page - creating a cache of theme settings or something. I am seeking the programmatic equivalent of clicking configure and navigating to that page.

eft’s picture

So is there any way to run this to add the theme settings to the variable table?

adaptivetheme_theme_get_default_settings('adaptivetheme_MyTheme');

eft’s picture

Jeff,

I put the following code in my profile

  .
  .
  .
/**
 * Implementation of hook_profile_tasks().
 */
function raintree_profile_tasks(&$task, $url) {
  .
  .
  .
  // disable Garland and enable raintree_theme and set it as site default theme
  db_query("UPDATE {system} SET status = 0 WHERE type = 'theme' and name ='%s'", 'garland');
  db_query("UPDATE {system} SET status = 1 WHERE type = 'theme' and name ='%s'", 'adaptivetheme_raintree');
  variable_set('theme_default', 'adaptivetheme_raintree');

  // populate variable table with theme settings
  include_once(drupal_get_path('theme', 'adaptivetheme') .'/theme-settings.php');
  adaptivetheme_theme_get_default_settings('adaptivetheme');
  adaptivetheme_theme_get_default_settings('adaptivetheme_raintree');
  .
  .
  .

This helped to pre configure the theme variables so that the various classes were added to HTML page elements.

Can you comment if this looks like a reasonable approach?

Jeff Burnz’s picture

Component: Code » CSS/HTML
Status: Active » Closed (works as designed)

I dont really want to be running db updates from the theme, its not really sustainable.