I want to get more control over the bootstrap classes on aside(s)/main content container.

bootstrap/themes/system/page.tpl.php has the aside classes hardcoded (col-sm-3) and in bootstrap/themes/system/page.vars.php there is logic that adds a class to the main content container depending on whether there is one sidebar, two sidebars or no sidebars (col-sm-6, col-sm-9, col-sm-12 respectively).

Anyway, following the normal Drupal pattern, I copied page.tpl.php and page.vars.php to my subtheme (mybootstrap) folder, changed function names in page.vars.php to 'mybootstrap' and flushed all caches.

In mybootstrap/page.vars.php I added a couple of classes of my own in order to test that it had worked, then flushed all caches again (drush cc all).

And it didn't work. I went on a search and found this page https://www.drupal.org/node/2140481 (Title: Page.vars.php) where various people have had the same problem. Some say the above method works for them, others say it doesn't.

Also suggested is to copy page.tpl.php to the subtheme and copy and paste the contents of page.vars.php in the subtheme template.php, then rename functions to 'mybootstrap_preprocess_page etc'.

I did this, flushed caches and again, it didn't work.

There is a link from the Page.vars.php page to https://www.drupal.org/node/2224003 (Title: Bootstrap Theme Registry Alters) which is supposed to help - but it's way above my pay grade! Any help would be much appreciated!
Note: I've got Bootstrap 7.x-3.0 installed.

Comments

wrender’s picture

I had a lot of problems like this with Bootstrap 7.x-3.0. I ended up using Bootstrap 7.x-3.1-beta3 for all of our production websites. Currently they are up to Bootstrap 7.x-3.1-beta3+11-dev (2015-Sep-22)

I had to end up taking the variables I wanted to alter, and put them in template.php and then clearing the caches: https://www.drupal.org/node/2467763

Wesley Render