Chris 2pha Brown. Drupal developer Brisbane Australia

Chris Brown

Drupal, Javascript, Three.js, 3D

website blog

drupal stuff

image for Moving blog from Drupal to static html

I recently moved my blog from Drupal to static html pages and the results are amazing. I am primarily a Drupal developer, and have been for about 10 years, so many years ago when I decided to add a blog to my personal site it was natural to choose Drupal. Drupal was easy to get a blog up and running quite easy and worked well, little consideration was given to actual site speed.Fast forward about.....

image for Drupal Migrate, Don't forget to de register your classes

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

image for Fixing drush * needs a higher bootstrap level to run

Today while setting up a Drupal dev environment on a new PC I encountered the drush error "Command needs a higher bootstrap level to run". The first thing I did as many probably would is do a quick search on google. This though yields many different results and fixes. The problem though is I didn't know why it was happening so I didn't know which fix would work.Turns out though it was quite easy.....

image for Javascript snippet for "jump to" functionality in Owl Carousel

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

image for Stopping Drupal spam registrations without an annoying captcha

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

image for Removing the entity ID from Drupal entity reference fields

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

image for Drupal Vehicle taxonomies pre configured and ready for import

Many times in the past I have wanted a taxonomy structure for things like car makes and models or Australian States and Suburbs and find myself recreating them every time. So today I decided its probably better to have them stored somewhere. Luckily the Taxonomy Manager module easily allows you to export and import taxonomy data easily. I know there are other options for importing and exporting.....

image for Drupal views exposed form in a bootstrap modal

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

image for Goomap - Not another Drupal mapping module

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

image for Drupal 7 - Changing taxonomy term link paths

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

image for Drupal 7 Bootstrap image field upload widget

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

image for Disable taxonomy term delete button if term has nodes

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

image for Drupal Domain Access user 1 menu

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

image for Drupal Bootstrap 3 theme media queries javascript event (like Omega 3)

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

image for Drupal Module - Watchdog Event Extras

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

image for Changing the Inline Entity Form autocomplete field to a select list

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

image for Drupal Migrate V2 and Addressfield

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