How to override Bootstrap3 GridFramework?

Permalink
I am using Bootstrap3 for layouts, and all is working great. However the default for the columns is to use col-sm. I have seen that there is a discussion on github (https://github.com/concrete5/concrete5-5.7.0/issues/476) about adding a feature to allow a user to change this. But until then I was wondering how can I override the Bootstrap3 class and use my own, so I can set the defaults to whatever I wish?

karladidas
 
MrKDilkington replied on at Permalink Reply
MrKDilkington
Hi karladidas,

The Bootstrap3.php file is setting the column classes.
concrete\src\Page\Theme\GridFramework\Type\Bootstrap3.php

You could make another grid type file called Bootstrap3med.php or Bootstrap3sm.php for example. Copy Bootstrap3.php, and change the class inside from "class Bootstrap3 extends GridFramework" to something like "class Bootstrap3med extends GridFramework".

In your theme, open page_theme.php and change (or add) "protected $pThemeGridFrameworkHandle = 'bootstrap3';" to "protected $pThemeGridFrameworkHandle = 'bootstrap3med';"
karladidas replied on at Permalink Reply
karladidas
Hi MrD,

Thanks for that option, I have actually just done exactly that as a stop gap, but don't really want to put new classes in the core. Any idea how to use a class from, for example a custom theme directory?
juddc replied on at Permalink Reply
juddc
That would be great feature. Let us know if you figure it out.
mesuva replied on at Permalink Reply
mesuva
I know of two ways to do this from within a theme's directory (so it's all nice and self contained). See my post here:

http://www.concrete5.org/community/forums/5-7-discussion/adding-cus...