April 12, 2016
Often times when writing a module to migrate content leveraging the Migrate module you will find yourself disabling and re enabling your module as you add classes to it.When you do this you might find that you get errors about classes not being found or that your migrations are still being displayed in the interface even though your module is disabled (when using a class from another module such.....
October 07, 2015
There are many modules out there to prevent spam registrations in Drupal, but many of them involve some sort of Captcha, which I hate, or a paid for service. Stopping fake site registrations should not make it harder for the legitimate people trying to register on your site, and having to pay to prevent spam does not sit well with me.While Drupal does have a setting to "Require email validation".....
October 07, 2015
Putting this here for my own future reference.It adds an input textfield under an owl carousel (2.0.0-beta.2.4) to jump to a certain item.Dots must be on to use the "to" method.It also includes some stuff for lazy loading as it did not seem to work when using the "to" method of the OwlCarousel. var container = $('.view-collection-item-viewer-new .view-content', context); var carousel = container.....
July 25, 2015
On a site I am currently working on I have a content type that includes an entity reference field. When creating a node, the entity reference autocomplete includes the entity id in the field after selecting the entity desired. This can be confusing for the user.When trying to find a solution to this problem I came across many issues and different proposed solutions including a sandbox module.....
March 15, 2015
I am currently working on a site with the Bootstrap theme which has a fullscreen views map (Goomap) with exposed filters. As the map is full screen I want to have the exposed filters inside a bootstrap modal. Luckily it is quite easy to theme the views exposed filters form. To do this you have to override the views exposed filters form theme file. Copy the views theme file.....
March 08, 2015
Yes, I have done it, created yet another Drupal mapping module. I call him Goomap. The first thing you are probably going to ask is "why?". Well, here's why: ComplexityMost of the time when trying to use one of the other Drupal mapping modules I would find the process far too complex. Especially the last time I used the Openlayers module. I wont go into detail about this but if you have used it.....
January 11, 2015
I have seen many questions on the web about how to change the path of the taxonomy term links, so it seems to be a common thing to want to do, I know I have wanted to do this on many projects. Recently on a project I wanted these links to point to a view with an exposed filter on taxonomy. As I had this view to list and filter nodes, there was no real reason for the standard taxonomy term pages.....
December 31, 2014
When using the Bootstrap theme in Drupal 7, the image upload widget leaves a lot to be desired. I looks pretty crappy Below is how I overcame this.It should probably work with file fields too but instead of overriding THEME_image_widget, you would override THEME_file_widget, though I haven't tried it yet. First, add this to your css .btn-file { position: relative; overflow: hidden; } .btn-file.....
December 28, 2014
The below snippet will disable the delete button on the taxonomy term edit page if the term has any nodes assigned to it. It implements hook_form_FORM_ID_alter() function hook_form_taxonomy_form_term_alter(&$form, &$form_state) { $query = db_select('taxonomy_index', 't'); $query->condition('tid', $form_state['term']->tid, '='); $query->join('node', 'n', 't.nid = n.nid'); $count =.....
October 22, 2014
Today when developing a Drupal site with the Domain Access module I had an interesting problem. My site is set up with a custom theme and 2 domains.My custom theme is using Zurb Foundation and so I had to override the main menu theme functions to add the Zurb classes.This was easily done by implementing theme_links__system_main_menu, theme_menu_tree__main_menu__submenu and.....
September 26, 2014
Having used the Omega 3 Drupal theme for a few years now I got quite use to writing javascript functions that would react to the 'reponsivelayout' event that was supplied by the theme. This event would fire after the responsive classes were applied to the body tag when the page loaded or when the media queries changed the site layout.I often used this event to create things like mobile menus and.....
June 25, 2014
When checking the logs on the Drupal sites I run I often find myself copying the IP and searching it on google. Most of the time it is when I'm looking at a page not found or login attempt failure and I would like to know if these came from some sort of spam or a legitimate user. This process became a little tedious, so I created the Watchdog Event Extras module. Basically what the module does is.....
June 20, 2014
The Inline Entity Form module for Drupal is an awesome module. Most people probably have experienced using it with Drupal Commerce, but it can be used when ever an Entity Reference field is used. I have personally used it on many projects, most of which were not commerce related. Sometimes though, the autocomplete field to select an existing entity is not appropriate, say if you only have a few.....
March 11, 2014
While trying to migrate data from a legacy CakePHP system to Drupal 7 recently I had a problem getting an Addressfield field to play nicely.What I had origianly was this (which did not work). $this->addFieldMapping('field_customer_address:thoroughfare', 'address'); $this->addFieldMapping('field_customer_address:locality', 'suburb');.....