Javascript

By adam
2015-06-14 08:48
2 comments
Daily Dose of Drupal Episode #208

Are you testing your site? Until recently, we weren’t and it was costing us. Every element on your website should have a meaning and if you aren’t testing it against something else how can you be sure that you are maximizing your results!

By shane
2015-05-10 09:08
3 comments
Daily Dose of Drupal Episode #207

Taking a content type and displaying it in a Drupal View is core to any Drupal website. If you are new to views, you can check out our Drupal views video. As you venture into views you will learn hundreds of ways to manipulate content to change the way the end user is able to interact with the content. To help enhance this, you can use the Views Isotope module. This module uses the jQuery isotope library to dynamically filter views content. As the title states, it’s pretty fancy.

By adam
2015-03-26 07:33
3 comments

Drupal 8 coming (queue suspenseful music)! One of the HUGE things with Drupal 8 is this term called "headless Drupal". Don't worry the Drupal drop isn't in any danger of losing precious head real estate, rather headless Drupal refers to using a different client-side (front-end) framework then the back end Drupal framework. From what I have read the goal is to have Drupal become the preferred back-end content management system.

By adam
2015-02-12 08:20
0 comments
Daily Dose of Drupal Episode #192

We kept things simple for this episode of the DDoD. The options element module uses Javascript to create an easy way to create radio button and checkbox options for fields on a Drupal content type. Before this module you had to add key|value for each options you wanted. Using this module the key and value is broken down into two fields making it easier to distinguish the difference.

By adam
2015-01-16 06:27
1 comment
Daily Dose of Drupal Episode #191

Just like your grandparents, the Superfish menu module is an oldy but a goodie. Since 2010, Superfish has been helping site owners implement the infamous dropdown menu. Over the years Superfish has been improved to include various features for touch screens, and responsive needs.

By adam
2014-10-15 07:36
6 comments
Daily Dose of Drupal Episode #173

In episode 173 you learn about how to make a simple countdown timer using the jQuery Countdown Timer module. This module, which uses jQuery, allows you to specify an end date which the countdown timer will countdown to. The countdown timer is available as a block and can be placed in any region that you desire for your website. Also, at this recording their was a minor bug that didn't allow for countdown dates to extend beyond 100 days (wouldn't display the third digit).

By adam
2014-09-26 08:12
0 comments
Daily Dose of Drupal Episode #170

In this DDoD we look at the jReject module. This module allows you to display a modal popup notifying the user / visitor that their browser is outdated and wont work well with the site. In the video, you will see that jReject comes with a wide variety of customizations to fit your brand and preferences. Another important thing to note is that jReject unlike other similar modules allow you to display a popup based on other browsers besides the common Internet Explorer.

By adam
2014-08-21 06:47
0 comments
Daily Dose of Drupal Episode #163

In part 2 of the multiple views series you will learn how to add the jQuery needed to switch between multiple classes. By having the ability to use multiple classes, we will (in part 3) be able to use CSS to change the look and feel of the same view.

Here is the jQuery code used to switch between grid and list view:

By adam
2014-08-14 06:50
4 comments
Daily Dose of Drupal Episode #162

In this episode, you will learn how to set up the foundation of building a view that can display content in multiple ways. This video highlights how to set up the content type and view to display the content. In the coming videos in this series, you will learn how to style and apply jQuery to change how the view displays the content.

Need help learning views? Look at our Drupal views intro.

By adam
2014-07-23 06:36
1 comment
Daily Dose of Drupal Episode #158

In this episode we cover the Splashify module. This module is used to display splash pages or popups. There are multiple configuration options available to fit your site needs.

In this episode you will learn:

  • How to set up Splashify
  • How to configure Splashify
  • How to get Splashify to use the Mobile Detect plugin
  • How Splashify displays to the end user
  • How to be awesome
By shane
2013-03-25 22:56
0 comments
Daily Dose of Drupal Episode #131

The Drupal 7 Floating Block module makes it easy to float a Drupal block along the sidebar as you scroll down the page. It uses a simple CSS selector to determine which blocks to float.

In this episode you will learn:

  • How to install and configure the Drupal 7 Floating Block module
  • How to determine the CSS selector to use for your block
  • How to get a Drupal block to float as you scroll down the page
By shane
2013-02-28 15:42
5 comments
Daily Dose of Drupal Episode #117

The Drupal 7 jQuery SelectBox module is a simple module that makes HTML select boxes easier to style. It replaces the HTML form select element with easier to style HTML markup.

In this episode you will learn:

  • How to download and install the jQuery SelectBox module
  • What the jQuery SelectBox module is doing in the background to make the select boxes on the site continue to work correctly

Thanks to Drupalize.me for sponsoring this episode.

By shane
2013-02-20 23:59
2 comments
Daily Dose of Drupal Episode #113

In the last two episodes, we covered building a basic Drupal 7 module that displayed a JavaScript confirmation before a user leaves a specific page. In this episode we continue where we left off and add the ability to display the JavaScript confirm form on specific content type node edit pages.

In this episode you will learn:

  • How to add a checkbox field on the administration form that displays all the content types on your Drupal site
  • How to verify you are on the node edit page of a specific content type
By shane
2013-02-19 22:54
0 comments
Daily Dose of Drupal Episode #112

In the last episode we covered creating a simple module to display a javascript confirmation popup before leaving a page. In this episode we take that a step further and add a nice administrative interface to the module.

In this episode you will learn:

  • How to implement hook_menu to add an administrative page to your custom Drupal module
  • How to build a Drupal administrative form
By shane
2013-02-18 18:23
3 comments
Daily Dose of Drupal Episode #111

Learning module development in Drupal is not easy, but this Daily Dose of Drupal episode provides a very simple but practical module development video tutorial to use when learning about Drupal Module development. If you have a complex form on your Drupal websites, whether it is a Node creation form or perhaps even a webform, you may want to warn users before they navigate away from the page. This can help inform users that if they navigate away from the page before submitting the form, they may lose the contents of the form.

By shane
2013-01-24 00:03
2 comments
Daily Dose of Drupal Episode #94

In this Daily Dose of Drupal episode, we really go for a double dose as we look at two modules that have very similar functionality. We first look at the Drupal 7 Scroll to Top module and see how it can be used to create a nice button that scrolls to the top of the page using JavaScript. We then look at the Drupal 7 Back to Top module to see how it differs. These modules do different things but they have different settings/configuration options that make them unique.

By shane
2012-11-23 11:24
13 comments

Drupal 7 Ajax Framework Example

For a Daily Dose of Drupal episode that covers this blog post topic as well, take a look at Drupal 7 Ajax Framework Link Example.

By shane
2012-09-10 11:24
13 comments

You may have run into a situation in Drupal 7 in which you only need to apply a JavaScript behavior one time. In most cases your JavaScript seems to be executing fine, however you might notice that sometimes things seem to be executing two times or more. This may be getting triggered by some type of AJAX call that causes your JavaScript behaviors to get executed again. In this post we will examine how we can prevent these duplicate behaviors from being applied by using a very simple example.

By shane
2012-06-11 09:54
2 comments

As a follow up and update to a post I wrote on Adding Javascript to your Drupal 6 module, I figured I would write a quick post on doing the same thing in Drupal 7.

It starts with adding the following line to your modules .info file (rename MYMODULE to your module name or the name you want to give to your javascript file):


scripts[] = MYMODULE.js

The next step is to create the MYMODULE.js file. The general template of the javascript file looks like:

(function ($) {
By shane
2011-08-03 14:01
0 comments

I recently ran across a problem where I needed to handle user input in a textfield in real-time. What I needed to do in my situation was to perform an AJAX call to my Drupal site as the user was typing into a textfield (to see if that value was available in the database). The main problem was that there were a few easy options for doing this in JQuery, but most of them were not good enough. Here are two of the options I tried.

Subscribe to Javascript