Drupal Bootstrap: Video Gallery for YouTube and Vimeo using a Custom Field Formatter and Video Embed Field module

I'm using the Video Embed Field Module and would like display this field as a gallery using the Bootstrap gallery at https://github.com/blueimp/Gallery, a touch-enabled, responsive and customizable image and video gallery.

Drupal Bootstrap: Image Gallery using Custom Field Formatter

I have an image field, using the the core image module, set to unlimited number of values. I want to create a custom field formatter so that these images are shown as thumbnails that when clicked pops up the Bootstrap image gallery. This gallery will be an extension to blueimp Gallery, a touch-enabled, responsive and customizable image and video gallery seen here: https://blueimp.github.io/Bootstrap-Image-Gallery/

Client-side validation in custom forms using Drupal, Bootstrap 3, and Boostrap Validator plugin

I need to add form client-side validation to my custom form. I'm using the Bootstrap theme but it doesn't include any type of validation so I decided to use the Bootstrap Validator plugin. Examples of validation can be found here: http://1000hz.github.io/bootstrap-validator/#validator-examples

Drupal Bootstrap: Quick theming tips

Custom Modal Window

Place the button below in your code to trigger the modal window. Click this button for an example:

Drupal Bootstrap: Add magnifying glass search icon to search button and change placeholder text

Out of the box the search button uses the word 'search', but I want to change this so it displays the magnifying glass Glyphicon instead. Also, I want to change the placeholder text from 'search' to something else.


To add the icon in our search button we need to us override bootstrap_bootstrap_search_form_wrapper(). We can do this by placing the following code in our theme's template.php file:

Drupal Bootstrap: Navbar drowpdown on hover with fade in transition

I needed to alter the Bootstrap navbar so that the dropdown would appear on mouse hover - Out of the box, it only appears when clicking the link.

Solution One

We need to override bootstrap_menu_link() in our template.php file by commenting out the lines that adds the classes 'dropdown-toggle' and 'dropdown'.

Quick reference to helpful Drush commands

Any good Drupal developer uses Drush. Below is a quick reference to helpful Drush commands.

Clearing the cache:

Form submit AJAX button not woking after inserting form using AJAX

I have a page with a link that when clicked loads and inserts an AJAX driven form into the page. When I click to load the form, AJAX does its business and inserts the form into the page, and when I use the form and submit it, it works fine - AJAX processes the form and my use of AJAX commands in the form callback removes the form from the page. However, if I try to reload that same form by clicking the link again, the form loads up but the submit button no longer uses AJAX. The annoying thing was that all the AJAX behaviors were definitely being reattached to the form.

Remember last active Vertical Tab using Cookies in Drupal

This is a quick reminder to myself so I don't forget in future. I need a way of remember what vertical tab was last active when the user revisits or refreshes the page. The only good way of doing this is by using cookies. The first thing to do is add the jquery.cookie.js file that ships with Drupal so we can use cookies within our JS: