For desktop width screens, we want to have:

$variables['content_column_class'] = ' class="col-sm-8"'; (8 columns instead of 9, and then set our sidebar_second to 4 columns in the page.tpl.php).

Since this variable for setting the content column class is set in page.vars.php, what would be the proper way to override this variable in our subtheme.

Thank you

Comments

wrender’s picture

My apologies. No sleep last night. I did not realize this could be done by overriding the functions in template.php. In our subtheme I just added the following (Modifying 9 to 8, and then cleared the cache.

function oursubthemename_bootstrap_preprocess_page(&$variables) {
  // Add information about the number of sidebars.
  if (!empty($variables['page']['sidebar_first']) && !empty($variables['page']['sidebar_second'])) {
    $variables['content_column_class'] = ' class="col-sm-6"';
  }
  elseif (!empty($variables['page']['sidebar_first']) || !empty($variables['page']['sidebar_second'])) {
    $variables['content_column_class'] = ' class="col-sm-8"';
  }
  else {
    $variables['content_column_class'] = ' class="col-sm-12"';
  }

  if(bootstrap_setting('fluid_container') === 1) {
    $variables['container_class'] = 'container-fluid';
  }
  else {
    $variables['container_class'] = 'container';
  }
}
markhalliwell’s picture

Status: Active » Closed (works as designed)
arne.olafson’s picture

Note that comment #1 has an extra `_bootstrap` in it, and should read:

function OURSUBTHEMENAME_preprocess_page(&$variables) {

Not:

function oursubthemename_bootstrap_preprocess_page(&$variables) {