Drupal: 7.x

Drupal form ajax submit button bootstrap dialogue confirm box

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'.

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.

Caching Render Arrays in Drupal 7

Render arrays in Drupal are great. If you do not know what a render array is then take a look here http://drupal.org/node/930760, but basically they are arrays that convert into HTML. Render arrays are used to allow other modules to override output before going through the theme layer. What happens though if you have a render array that does a lot of processing? You do not want that array, or part of that array, running each time the page is called.

Here I describe how to cache a render array. Firstly, we need a render array:

Themeing a form into a table with draggable rows in Drupal 7

What I want is a form themed into a table, but I also want to to make the rows draggable so I can change the weight of each form entry. Below is an example of one way this can be done in Drupal 7. As an example, lets say we have an array of the main characters in the BBC series Red Dwarf (not including Holly). We want to display those characters into a form so our user can change those details, if they so wish.