This page documents Bootstrap classes transition targeted for Tiki 13 and onwards to help Tiki themers and designers.
1) download bootstrap files (http://getbootstrap.com/), copy bootstrap.css to your /styles folder
2) create a bootstrap folder in the /styles folder
3) copy to /styles/bootstrap the downloaded bootstrap.js file and rename it to custom.js
4) in the admin panel switch your theme to bootstrap
Location: vendor/bootstrap/
To include bootstrap in a tiki theme, create a theme css file (eg. tiki-bootstrap.css) in the following folder: styles/
In the created css file use the @import css function before any css setting as described below:
/*Import Bootstrap*/ @import url("../vendor/bootstrap/dist/css/bootstrap.css");
use classes, don't use ids - Tiki uses id selectors only in some core areas (eg: to define main zones). Feature specific styling should not include id selectors.
External sources come with their own styling. How is this neutralized and turned into Tiki styling?
Vendor (external) source codes contain lots of own formatting. This causes problems when trying to achieve a unified look&feel. For example jquery-ui is nice, but has its own styling. Using bootstrap how will a jquery-ui dropdown will look the same as a dropdown anywhere else in Tiki? Or a button?
One way is to simply add the needed classes, stop and override the usage of external css. This might work for buttons, tables, hyperlinks, etc, but how about divs?
How to approach and handle buttons
Tiki sometimes uses hyperlinks ( a> tag), sometimes input type submit, sometime buttons
How to unify?
Bootstrap has a navbar component (http://getbootstrap.com/components/#navbar) that could be used as a standard background for buttons.
A way could be to agree on a naming convention, assign type or class accordingly in tiki templates, than use the smarty function to add the bootstrap class for styling.
An approach could be for example according to functionality:
issue #1: Bootstrap offers button style and size options, which one to pick? See http://getbootstrap.com/css/#buttons
issue #2: use span tag or add class directly in the element?
eg: I dont like that on the edit page the save button class is btn-primary, I want it to look like btn-warning, how do I do that without modifying php or tpl source files?
btn class added;
<span class="button" ...>
renders now in mobile mode as
<span class="btn button" ...>
otherwise
<a class="btn" data-role="button" ...>
These changes will be made in templates/layouts/bs_grid (or some name indicating Bootstrap grid compatibility. At issue is where to add class="row" container divs.
In parallel with this, presumably the idea of moving everything in the center column to modules will happen. This will simplify the template and give a lot of flexibility to page layout as well.
This includes the top module zone, topbar module zone, side columns, center content (less div#role_main, which should be addressed separately), page bottom module zone (bottom of center column), and footer (bottom module zone).
gezza: The classes on layout-view.tpl are going to be simplified or we keep them? What is the plan for shadowlayers, fullscreen, fixedwith? Clearfix classes?
<body> <div id="main" class="row"> <div class="col-md-12"> <div class="header_outer row"> <div class="header_container col-md-12"> </div> <div class="middle_outer row"> <div id="middle" class="clearfix fixedwidth middle col-md-12"> <div class="row"> <div class="col-md-12"> <div id="topbar_modules" class="content clearfix modules"> </div> </div> <div class="row"> <div id="c1c2" class="clearfix col-md-9"> <div class="row"> <div id="wrapper" class="clearfix col-md-9 col-md-9-push-3"> </div> <div id="col2" class="col-md-3 col-md-3-pull-9"> </div> </div> </div> <div id="col3" class="clearfix col-md-3"> </div> </div> </div> </div> <footer id="footer" class="footer"> <div class="footer_liner row"> <div class="fixedwidth footerbgtrap col-md-12"> </div> </div> </footer> </div> </div> </body>
IMO (), we can have several layouts and the designer or site admin can choose which to use, or can add another. For example:
These templates/layouts/responsive_fivealive.tpl etc. layouts can be added or removed as we experiment with the possibilities.
In my opinion, there's no particular reason to keep old divs and div classes like the shadow divs in layouts other than Classic. If one goal of being Bootstrap compatible is to attract devs and designers who are familiar with Bootstrap, we should provide templates that are clean and familiar as much as possible, not cluttered. Also, Bootstrap provides for the "full-width" and "fixed-width" properties, so I don't think we need explicit divs/classes distinct from Bootstrap's.