SlideShare a Scribd company logo
1 of 43
Download to read offline
Improve theming with 
(Twitter) Bootstrap 
Yurtaev Andrey 
@i_amdroid
What is bootstrap? 
“The most popular front-end framework for 
developing responsive, mobile first projects 
on the web.” 
getbootstrap.com
Benefits 
● standardization of markup 
● popularity 
● extensibility
d.o themes 
Bootstrap 3 
● Bootstrap dgo.to/bootstrap 
● Bootstrap Barrio dgo.to/bootstrap_barrio 
● Bootstrap Business dgo.to/bootstrap-business 
● Radix dgo.to/radix 
● Circle dgo.to/circle 
Bootstrap 2 
● Tweme dgo.to/tweme 
● Elimai dgo.to/elimai
Examples
Bootstrap 
basic theme, 
navbar, wells, tooltips, 
many settings
Bootstrap Barrio 
bootstrap subtheme, 
basic theme
Bootstrap 
Business 
colors, looks great
Radix 
basic theme, 
for panopoly, 
bootswatch compatible
bootswatch.com - choose theme, 
for example, flatly 
drush radix "Flatly" --bootswatch=flatly 
easy, but requires compass and other gems
Circle 
for panels, very basic, 
many settings, 
no bs classes for 
standart elements
Tweme 
ready to use
Elimai
More Drupal themes 
themeforest.net 
more than 100 professional drupal themes 
based on bootstrap 
price 40-50$
Examples
Consilium 
d7.to/consilium
Dawn 
d7.to/dawn
Realia 
d7.to/realia
Make own Bootstrap theme 
MYTHEME.info: 
name = MYTHEME 
core = 7.x 
description = Bootstrap start theme. 
dependencies[] = jquery_update 
base theme = html5
template.php: 
function MYTHEME_preprocess_html(&$variables) { 
drupal_add_css('//netdna.bootstrapcdn.com/ 
bootstrap/3.1.1/css/bootstrap.min.css', 
array('type' => 'external')); 
drupal_add_js('//netdna.bootstrapcdn.com/ 
bootstrap/3.1.1/js/bootstrap.min.js', 
array('type' => 'external')); 
}
page.tpl.php: 
<!-- mark up from http://getbootstrap.com/components/#navbar --> 
<nav role="navigation" class="navbar navbar-default"> 
<div class="container-fluid"><div class="navbar-header"> 
<button type="button" class="navbar-toggle" data-toggle="collapse" 
data-target="#bs-example-navbar-collapse-1"> 
<span class="sr-only">Toggle navigation</span> 
<span class="icon-bar"></span> 
<span class="icon-bar"></span> 
<span class="icon-bar"></span> 
</button> 
<a class="navbar-brand" href="#"><?php print $site_name; ?></a> 
</div> 
<div class="collapse navbar-collapse" 
id="bs-example-navbar-collapse-1"> 
<?php print theme('links__system_main_menu', 
array('links' => $main_menu, 'attributes' => array( 
'id' => 'main-menu', 'class' => array('nav', 'navbar-nav')))); ?> 
</div></div> 
</nav>
Result
Preprocess 
template.php: 
/** 
* Override theme_menu_local_tasks(). 
* Add Bootstrap class to menu 
*/ 
function MYTHEME_menu_tree($variables) { 
return 
'<ul class="menu nav">' . $variables['tree'] . '</ul>'; 
}
function MYTHEME_menu_local_tasks(&$variables) { 
$output = ''; 
if (!empty($variables['primary'])) { 
$variables['primary']['#prefix'] = '<h2 
class="element-invisible">' . t('Primary tabs') . '</h2>'; 
$variables['primary']['#prefix'] .= '<ul class="nav nav-tabs">'; 
$variables['primary']['#suffix'] = '</ul>'; 
$output .= drupal_render($variables['primary']); 
} 
if (!empty($variables['secondary'])) { 
$variables['secondary']['#prefix'] = '<h2 
class="element-invisible">' . t('Secondary tabs') . '</h2>'; 
$variables['secondary']['#prefix'] .= '<ul class="nav nav-tabs">'; 
$variables['secondary']['#suffix'] = '</ul>'; 
$output .= drupal_render($variables['secondary']); 
} 
return $output; 
}
So, we will get... 
Bootstrap 
(d.o theme)
Or... 
Glook 
d7.to/glook-sb
Glook 
ready to use, 
flexbox
Approaches 
Classic way 
● a lot of css 
● little bit preprocess 
● different look 
BS subtheme or own theme 
● little bit css 
● a lot of preprocess 
● close to default look 
Another way 
● little bit of Sass (or 
Less) 
● no preprocess 
● different look
Bootstrap SASS 
github.com/twbs/bootstrap-sass 
gem install bootstrap-sass 
compass create MYTHEME -r bootstrap-sass 
--using bootstrap
Theme files 
template.php: 
/* disable cdn 
function MYTHEME_preprocess_html(&$variables) { 
... 
} 
*/
MYTHEME.info: 
stylesheets[all][] = css/styles.css 
scripts[] = js/bootstrap/collapse.js 
...
styles.scss: 
// customize bootstrap variables here: 
@import "variables"; 
@import "bootstrap"; 
.links, .links li { list-style: none; padding: 0; } 
.links li a { @extend .btn; @extend .btn-info; }
Result
In sum
Actually 
only on themeforest, 
but there are: 
● templatemonster.com 
● templateshop.be 
● dreamtemplate.com 
● and many others
Bootstrap tools 
● bootsnipp.com/resources 
● d7.to/bs-tools 
● d7.to/bs-tools4d
Thank You 
Questions?

More Related Content

What's hot

Make your own wp cli command in 10min
Make your own wp cli command in 10minMake your own wp cli command in 10min
Make your own wp cli command in 10minIvelina Dimova
 
7 reasons why developers should love Joomla!
7 reasons why developers should love Joomla!7 reasons why developers should love Joomla!
7 reasons why developers should love Joomla!Bartłomiej Krztuk
 
WordPress 15th Meetup - Build a Theme
WordPress 15th Meetup - Build a ThemeWordPress 15th Meetup - Build a Theme
WordPress 15th Meetup - Build a ThemeFadi Nicolas Zahhar
 
Goodbye hook_menu() - Routing and Menus in Drupal 8
Goodbye hook_menu() - Routing and Menus in Drupal 8Goodbye hook_menu() - Routing and Menus in Drupal 8
Goodbye hook_menu() - Routing and Menus in Drupal 8Exove
 
You're Doing it Wrong - WordCamp Orlando
You're Doing it Wrong - WordCamp OrlandoYou're Doing it Wrong - WordCamp Orlando
You're Doing it Wrong - WordCamp OrlandoChris Scott
 
Vancouver League of Drupallers - Remembering the User (August 2008)
Vancouver League of Drupallers - Remembering the User (August 2008)Vancouver League of Drupallers - Remembering the User (August 2008)
Vancouver League of Drupallers - Remembering the User (August 2008)baronmunchowsen
 
Image manipulation in WordPress 3.5
Image manipulation in WordPress 3.5Image manipulation in WordPress 3.5
Image manipulation in WordPress 3.5Marko Heijnen
 
Apostrophe
ApostropheApostrophe
Apostrophetompunk
 
WordPress 3.4 Theme Customizer
WordPress 3.4 Theme CustomizerWordPress 3.4 Theme Customizer
WordPress 3.4 Theme CustomizerChandra Maharzan
 
Shortcodes In-Depth
Shortcodes In-DepthShortcodes In-Depth
Shortcodes In-DepthMicah Wood
 
Intro To jQuery In Drupal
Intro To jQuery In DrupalIntro To jQuery In Drupal
Intro To jQuery In DrupalMatthew Farina
 
那些年,我用 Django Admin 接的案子
那些年,我用 Django Admin 接的案子那些年,我用 Django Admin 接的案子
那些年,我用 Django Admin 接的案子flywindy
 
Oop php 5
Oop php 5Oop php 5
Oop php 5phpubl
 
WordPress Theme Design and Development Workshop - Day 3
WordPress Theme Design and Development Workshop - Day 3WordPress Theme Design and Development Workshop - Day 3
WordPress Theme Design and Development Workshop - Day 3Mizanur Rahaman Mizan
 

What's hot (20)

Make your own wp cli command in 10min
Make your own wp cli command in 10minMake your own wp cli command in 10min
Make your own wp cli command in 10min
 
Advanced theming
Advanced themingAdvanced theming
Advanced theming
 
18. images in symfony 4
18. images in symfony 418. images in symfony 4
18. images in symfony 4
 
7 reasons why developers should love Joomla!
7 reasons why developers should love Joomla!7 reasons why developers should love Joomla!
7 reasons why developers should love Joomla!
 
WordPress 15th Meetup - Build a Theme
WordPress 15th Meetup - Build a ThemeWordPress 15th Meetup - Build a Theme
WordPress 15th Meetup - Build a Theme
 
Goodbye hook_menu() - Routing and Menus in Drupal 8
Goodbye hook_menu() - Routing and Menus in Drupal 8Goodbye hook_menu() - Routing and Menus in Drupal 8
Goodbye hook_menu() - Routing and Menus in Drupal 8
 
You're Doing it Wrong - WordCamp Orlando
You're Doing it Wrong - WordCamp OrlandoYou're Doing it Wrong - WordCamp Orlando
You're Doing it Wrong - WordCamp Orlando
 
Vancouver League of Drupallers - Remembering the User (August 2008)
Vancouver League of Drupallers - Remembering the User (August 2008)Vancouver League of Drupallers - Remembering the User (August 2008)
Vancouver League of Drupallers - Remembering the User (August 2008)
 
Image manipulation in WordPress 3.5
Image manipulation in WordPress 3.5Image manipulation in WordPress 3.5
Image manipulation in WordPress 3.5
 
Apostrophe
ApostropheApostrophe
Apostrophe
 
WordPress 3.4 Theme Customizer
WordPress 3.4 Theme CustomizerWordPress 3.4 Theme Customizer
WordPress 3.4 Theme Customizer
 
20110820 header new style
20110820 header new style20110820 header new style
20110820 header new style
 
An Introduction to Drupal
An Introduction to DrupalAn Introduction to Drupal
An Introduction to Drupal
 
Mojolicious
MojoliciousMojolicious
Mojolicious
 
Shortcodes In-Depth
Shortcodes In-DepthShortcodes In-Depth
Shortcodes In-Depth
 
Modular and Event-Driven JavaScript
Modular and Event-Driven JavaScriptModular and Event-Driven JavaScript
Modular and Event-Driven JavaScript
 
Intro To jQuery In Drupal
Intro To jQuery In DrupalIntro To jQuery In Drupal
Intro To jQuery In Drupal
 
那些年,我用 Django Admin 接的案子
那些年,我用 Django Admin 接的案子那些年,我用 Django Admin 接的案子
那些年,我用 Django Admin 接的案子
 
Oop php 5
Oop php 5Oop php 5
Oop php 5
 
WordPress Theme Design and Development Workshop - Day 3
WordPress Theme Design and Development Workshop - Day 3WordPress Theme Design and Development Workshop - Day 3
WordPress Theme Design and Development Workshop - Day 3
 

Similar to Improve theming with (Twitter) Bootstrap

8 things to know about theming in drupal 8
8 things to know about theming in drupal 88 things to know about theming in drupal 8
8 things to know about theming in drupal 8Logan Farr
 
D7 theming what's new - London
D7 theming what's new - LondonD7 theming what's new - London
D7 theming what's new - LondonMarek Sotak
 
Drupal 8 Theme System: The Backend of Frontend
Drupal 8 Theme System: The Backend of FrontendDrupal 8 Theme System: The Backend of Frontend
Drupal 8 Theme System: The Backend of FrontendAcquia
 
Debugging in drupal 8
Debugging in drupal 8Debugging in drupal 8
Debugging in drupal 8Allie Jones
 
Drupal vs WordPress
Drupal vs WordPressDrupal vs WordPress
Drupal vs WordPressWalter Ebert
 
Drupal 8: Theming
Drupal 8: ThemingDrupal 8: Theming
Drupal 8: Themingdrubb
 
Drupal 7 Theming - Behind the scenes
Drupal 7 Theming - Behind the scenes Drupal 7 Theming - Behind the scenes
Drupal 7 Theming - Behind the scenes ramakesavan
 
Twitter bootstrap on rails
Twitter bootstrap on railsTwitter bootstrap on rails
Twitter bootstrap on railsMasakuni Kato
 
Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011Ryan Price
 
Headless Drupal
Headless DrupalHeadless Drupal
Headless Drupaldrubb
 
Learning the basics of the Drupal API
Learning the basics of the Drupal APILearning the basics of the Drupal API
Learning the basics of the Drupal APIAlexandru Badiu
 
WordPress plugin #3
WordPress plugin #3WordPress plugin #3
WordPress plugin #3giwoolee
 
Intro to Theming Drupal, FOSSLC Summer Camp 2010
Intro to Theming Drupal, FOSSLC Summer Camp 2010Intro to Theming Drupal, FOSSLC Summer Camp 2010
Intro to Theming Drupal, FOSSLC Summer Camp 2010Emma Jane Hogbin Westby
 
Grok Drupal (7) Theming
Grok Drupal (7) ThemingGrok Drupal (7) Theming
Grok Drupal (7) ThemingPINGV
 
Rails Antipatterns | Open Session with Chad Pytel
Rails Antipatterns | Open Session with Chad Pytel Rails Antipatterns | Open Session with Chad Pytel
Rails Antipatterns | Open Session with Chad Pytel Engine Yard
 
What's new in the Drupal 7 API?
What's new in the Drupal 7 API?What's new in the Drupal 7 API?
What's new in the Drupal 7 API?Alexandru Badiu
 
Building a Custom Theme in Drupal 8
Building a Custom Theme in Drupal 8Building a Custom Theme in Drupal 8
Building a Custom Theme in Drupal 8Anne Tomasevich
 
Advanced Drupal Views: Theming your View
Advanced Drupal Views: Theming your ViewAdvanced Drupal Views: Theming your View
Advanced Drupal Views: Theming your ViewRyan Cross
 
WordPress Developers Israel Meetup #1
WordPress Developers Israel Meetup #1WordPress Developers Israel Meetup #1
WordPress Developers Israel Meetup #1Yoav Farhi
 

Similar to Improve theming with (Twitter) Bootstrap (20)

8 things to know about theming in drupal 8
8 things to know about theming in drupal 88 things to know about theming in drupal 8
8 things to know about theming in drupal 8
 
D7 theming what's new - London
D7 theming what's new - LondonD7 theming what's new - London
D7 theming what's new - London
 
Drupal 8 Theme System: The Backend of Frontend
Drupal 8 Theme System: The Backend of FrontendDrupal 8 Theme System: The Backend of Frontend
Drupal 8 Theme System: The Backend of Frontend
 
Debugging in drupal 8
Debugging in drupal 8Debugging in drupal 8
Debugging in drupal 8
 
Drupal vs WordPress
Drupal vs WordPressDrupal vs WordPress
Drupal vs WordPress
 
Drupal 8: Theming
Drupal 8: ThemingDrupal 8: Theming
Drupal 8: Theming
 
Drupal 7 Theming - Behind the scenes
Drupal 7 Theming - Behind the scenes Drupal 7 Theming - Behind the scenes
Drupal 7 Theming - Behind the scenes
 
Twitter bootstrap on rails
Twitter bootstrap on railsTwitter bootstrap on rails
Twitter bootstrap on rails
 
Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011
 
Headless Drupal
Headless DrupalHeadless Drupal
Headless Drupal
 
Learning the basics of the Drupal API
Learning the basics of the Drupal APILearning the basics of the Drupal API
Learning the basics of the Drupal API
 
WordPress plugin #3
WordPress plugin #3WordPress plugin #3
WordPress plugin #3
 
Intro to Theming Drupal, FOSSLC Summer Camp 2010
Intro to Theming Drupal, FOSSLC Summer Camp 2010Intro to Theming Drupal, FOSSLC Summer Camp 2010
Intro to Theming Drupal, FOSSLC Summer Camp 2010
 
Grok Drupal (7) Theming
Grok Drupal (7) ThemingGrok Drupal (7) Theming
Grok Drupal (7) Theming
 
Django crush course
Django crush course Django crush course
Django crush course
 
Rails Antipatterns | Open Session with Chad Pytel
Rails Antipatterns | Open Session with Chad Pytel Rails Antipatterns | Open Session with Chad Pytel
Rails Antipatterns | Open Session with Chad Pytel
 
What's new in the Drupal 7 API?
What's new in the Drupal 7 API?What's new in the Drupal 7 API?
What's new in the Drupal 7 API?
 
Building a Custom Theme in Drupal 8
Building a Custom Theme in Drupal 8Building a Custom Theme in Drupal 8
Building a Custom Theme in Drupal 8
 
Advanced Drupal Views: Theming your View
Advanced Drupal Views: Theming your ViewAdvanced Drupal Views: Theming your View
Advanced Drupal Views: Theming your View
 
WordPress Developers Israel Meetup #1
WordPress Developers Israel Meetup #1WordPress Developers Israel Meetup #1
WordPress Developers Israel Meetup #1
 

Recently uploaded

Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 

Recently uploaded (20)

Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 

Improve theming with (Twitter) Bootstrap

  • 1. Improve theming with (Twitter) Bootstrap Yurtaev Andrey @i_amdroid
  • 2. What is bootstrap? “The most popular front-end framework for developing responsive, mobile first projects on the web.” getbootstrap.com
  • 3.
  • 4. Benefits ● standardization of markup ● popularity ● extensibility
  • 5. d.o themes Bootstrap 3 ● Bootstrap dgo.to/bootstrap ● Bootstrap Barrio dgo.to/bootstrap_barrio ● Bootstrap Business dgo.to/bootstrap-business ● Radix dgo.to/radix ● Circle dgo.to/circle Bootstrap 2 ● Tweme dgo.to/tweme ● Elimai dgo.to/elimai
  • 7. Bootstrap basic theme, navbar, wells, tooltips, many settings
  • 8.
  • 9. Bootstrap Barrio bootstrap subtheme, basic theme
  • 11. Radix basic theme, for panopoly, bootswatch compatible
  • 12. bootswatch.com - choose theme, for example, flatly drush radix "Flatly" --bootswatch=flatly easy, but requires compass and other gems
  • 13. Circle for panels, very basic, many settings, no bs classes for standart elements
  • 15.
  • 17. More Drupal themes themeforest.net more than 100 professional drupal themes based on bootstrap price 40-50$
  • 22. Make own Bootstrap theme MYTHEME.info: name = MYTHEME core = 7.x description = Bootstrap start theme. dependencies[] = jquery_update base theme = html5
  • 23. template.php: function MYTHEME_preprocess_html(&$variables) { drupal_add_css('//netdna.bootstrapcdn.com/ bootstrap/3.1.1/css/bootstrap.min.css', array('type' => 'external')); drupal_add_js('//netdna.bootstrapcdn.com/ bootstrap/3.1.1/js/bootstrap.min.js', array('type' => 'external')); }
  • 24. page.tpl.php: <!-- mark up from http://getbootstrap.com/components/#navbar --> <nav role="navigation" class="navbar navbar-default"> <div class="container-fluid"><div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="#"><?php print $site_name; ?></a> </div> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <?php print theme('links__system_main_menu', array('links' => $main_menu, 'attributes' => array( 'id' => 'main-menu', 'class' => array('nav', 'navbar-nav')))); ?> </div></div> </nav>
  • 26.
  • 27. Preprocess template.php: /** * Override theme_menu_local_tasks(). * Add Bootstrap class to menu */ function MYTHEME_menu_tree($variables) { return '<ul class="menu nav">' . $variables['tree'] . '</ul>'; }
  • 28. function MYTHEME_menu_local_tasks(&$variables) { $output = ''; if (!empty($variables['primary'])) { $variables['primary']['#prefix'] = '<h2 class="element-invisible">' . t('Primary tabs') . '</h2>'; $variables['primary']['#prefix'] .= '<ul class="nav nav-tabs">'; $variables['primary']['#suffix'] = '</ul>'; $output .= drupal_render($variables['primary']); } if (!empty($variables['secondary'])) { $variables['secondary']['#prefix'] = '<h2 class="element-invisible">' . t('Secondary tabs') . '</h2>'; $variables['secondary']['#prefix'] .= '<ul class="nav nav-tabs">'; $variables['secondary']['#suffix'] = '</ul>'; $output .= drupal_render($variables['secondary']); } return $output; }
  • 29. So, we will get... Bootstrap (d.o theme)
  • 31. Glook ready to use, flexbox
  • 32. Approaches Classic way ● a lot of css ● little bit preprocess ● different look BS subtheme or own theme ● little bit css ● a lot of preprocess ● close to default look Another way ● little bit of Sass (or Less) ● no preprocess ● different look
  • 33. Bootstrap SASS github.com/twbs/bootstrap-sass gem install bootstrap-sass compass create MYTHEME -r bootstrap-sass --using bootstrap
  • 34. Theme files template.php: /* disable cdn function MYTHEME_preprocess_html(&$variables) { ... } */
  • 35. MYTHEME.info: stylesheets[all][] = css/styles.css scripts[] = js/bootstrap/collapse.js ...
  • 36. styles.scss: // customize bootstrap variables here: @import "variables"; @import "bootstrap"; .links, .links li { list-style: none; padding: 0; } .links li a { @extend .btn; @extend .btn-info; }
  • 38.
  • 40.
  • 41. Actually only on themeforest, but there are: ● templatemonster.com ● templateshop.be ● dreamtemplate.com ● and many others
  • 42. Bootstrap tools ● bootsnipp.com/resources ● d7.to/bs-tools ● d7.to/bs-tools4d