If you are using the [Bootstrap](http://getbootstrap.com/) framework to create responsive Templates, the *Bootstrap Service of the TemplateTools* is the icing on the cake for you. The Bootstrap Service support you with some helpful functions: * [`$template['bootstrap']->alert()`](#alert) * [`$template['bootstrap']->breadcrumb()`](#breadcrumb) * [`$template['bootstrap']->locale_navigation()`](#locale_navigation) * [`$template['bootstrap']->nav()`](#nav) * [`$template['bootstrap']->pager()`](#pager) * [`$template['bootstrap']->sitelinks_navigation()`](#sitelinks_navigation) * [`$template['bootstrap']->social_sharing_buttons()`](#social_sharing_buttons) ###`alert()`, `bootstrap_alert()` Parameter * `string $message` - the message to alert * `array $options` - optional, default = `array()` * `boolean $prompt` - optional, default = `true` (`php` only) Usage `php` alert("I'm a alert!"); ?> Usage `twig` (as [Function](http://twig.sensiolabs.org/doc/templates.html#functions)) {{ bootstrap_alert("I'm a alert!") }} Requirements * `bootstrap.min.css` * `jquery.min.js` * `bootstrap.min.js` This function create a [Bootstrap Alert Component](http://getbootstrap.com/components/#alerts). You can use the `$options` array to fit the Alert to your needs: {{ bootstrap_alert('Hello %guest%', { 'type' : 'alert-info', 'parameter' : { '%guest%' : CMS_USER_DISPLAYNAME }, 'translate' : true, 'dismissable' : true, 'template_directory' : '@pattern/bootstrap/function/alert/' }) }} By default `bootstrap_alert()` will try to translate the `$message`, you can submit `'parameter'` for the [translation](Translator-Service) as array. If you set `'translate'` to `false`, the translation service is switched off and `'parameter'` will be ignored. If `'dismissable'` is `true` (default), Alert will be shown as [Dismissable Alert](http://getbootstrap.com/components/#alerts-dismissable). By default the Alert will load the needed templates from the `'template_directory'` => `'@pattern/bootstrap/function/alert/'` - you can define any other namespace to load the templates from. ###`breadcrumb()`, `bootstrap_breadcrumb()` Parameter * `array $options` - optional, default = `array()` * `boolean $prompt` - optional, default = `true` (`php` only) Usage `php` breadcrumb(); ?> Usage `twig` (as [Function](http://twig.sensiolabs.org/doc/templates.html#functions)) {{ bootstrap_breadcrumb() }} Requirements * `bootstrap.min.css` * `jquery.min.js` * `bootstrap.min.js` This function create a Breadcrumb Navigation for the current page as [Bootstrap Breadcrumb Component](http://getbootstrap.com/components/#breadcrumbs). You can use the `$options` array to fit the Breadcrumb to your needs: {{ bootstrap_breadcrumb({ 'link_home' : true, 'menu_level': 0, 'template_directory' : '@pattern/bootstrap/function/breadcrumb/' }) }} `'link_home'` is by default `true` and will show a linked Home Icon at the first position of the Breadcrumb. By default the Breadcrumb will load the needed templates from the `'template_directory'` => `'@pattern/bootstrap/function/breadcrumb/'` - you can define any other namespace to load the templates from. ###`locale_navigation()`, `bootstrap_locale_navigation()` Parameter * `array $options` - optional, default = `array()` * `boolean $prompt` - optional, default = `true` (`php` only) Usage `php` locale_navigation(); ?> Usage `twig` (as [Function](http://twig.sensiolabs.org/doc/templates.html#functions)) {{ bootstrap_locale_navigation() }} Requirements * `pattern.min.css` This function will create a locale navigation which enable the user to switch between different languages. `locale_navigation()` will parse the CMS page tree and extract the top level entries to build the locale navigation. The function expect a [page structure for multilingual websites](http://www.websitebaker.org/en/help/designer-guide/multilingual-websites.php?lang=EN) as described in the WebsiteBaker documentation. `locale_navigation()` expect the language codes in [ISO 639-1](http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) and will provide you with the *international language name* and also with the *native language name*. If you have set up your page for German and English languages this will return a navigation with two flags: ![](https://github.com/phpManufaktur/kfTemplateTools/wiki/image/locale_navigation_01.png) which indicate that *German* is active and *English* can be selected. By default the navigation will switch to the first page of the selected locale. It is more user-friendly to switch from the current page to the fitting page in the selected locale. To realize this, `locale_navigation()` must know which pages belong together. You can use the [`page_option()`](CMS-Service#page_option) feature and set the option `locale_id` with identical values for the fitting pages. For example, you have a page in English language at: http://domain.tld/page/en/about-us.php and a page with the same content but in German language at: http://domain.tld/page/de/ueber-uns.php Now you can set the option `locale_id` in keyword field of the page settings of both pages to the value `about`: [locale_id:about], Keyword 1, Keyword 2 Repeat this for all fitting pages in all languages. `locale_navigation()` will use this information to build fitting links in the language selection. If you are using [LEPTON CMS](http://lepton-cms.org) or [BlackCat CMS](http://blackcat-cms.org) you can also set the URL of the pages, which belong together, to the same *name* (see: [Mehrsprachige Webseiten mit LEPTON CMS](https://blog.phpmanufaktur.de/de/article/languagemenu-mehrsprachige-webseiten.php)), `locale_navigation()` will detect the fitting pages and create the correct links. Use the `$options` array to fit `locale_navigation()` to your needs, `twig` example with the *default* values: {{ bootstrap_locale_navigation({ 'locales' : null, 'menu' : 1, 'visibility' : [ 'public' ], 'template_directory' : '@pattern/bootstrap/function/locale/' }) }} With `locales` you can manually define the languages to use as array `['de','en','fr']`, select another `menu` as the default, change the `visibility` or the `template_directory`. ###`nav()`, `bootstrap_nav()` Parameter * `string $class` - the classes you want to use for the [Bootstrap Nav Component](http://getbootstrap.com/components/#nav) * `array $options` - optional, default = `array()` * `boolean $prompt` - optional, default = `true` (`php` only) Usage `php` nav('nav nav-pills'); ?> Usage `twig` (as [Function](http://twig.sensiolabs.org/doc/templates.html#functions)) {{ bootstrap_nav('nav nav-pills') }} Requirements * `bootstrap.min.css` * `pattern.min.css` * `jquery.min.js` * `bootstrap.min.js` This function generate the page navigation links from the Content Management System and return it as unsorted `