Article
Posted on 18th December 2018
Takes about 3 mins to read
There's nothing like Drupal's default spinning blue AJAX animation to make you notice that a site's design hasn't been fully customised. The code from my previous article showing how to fetch a link over AJAX to open in a Foundation reveal popup would suffer from this without some further customisation. After clicking the 'Enquire' button, a loading icon of some kind is needed whilst the linked content is fetched. By default, Drupal just sticks that blue 'throbber' next to the link, but that looks totally out of place. Our client's site uses a loading graphic that feels much more appropriate in style and placement, but my point is that you can set up your own bespoke version. Since it's Christmas, let's add some festive fun!
Article
Posted on 4th December 2018
Takes about 7 mins to read

Let me take you on a journey. We'll pass by Drupal content renderer services, AJAX commands, javascript libraries and a popular front-end framework. If you've only heard of one or two of those things, come lean on the experience I took diving deep into Drupal. I'm pleased with where my adventure took me to, and maybe what I learned will be useful to you too. Here's the end result: a contact form, launched from a...

Article
Posted on 14th February 2012
Takes about 2 mins to read

Part 1: Make the link work without javascript In this example we have a table listing log entries of some kind. We want to put a delete link against each log entry allowing the administrator to delete the log entry: The following code is responsible for printing out each link onto the page: $query = array( 'tok' => drupal_get_token('delete_log_item' . $flid), ) + drupal_get_destination(); $output[] = l(t('Delete'), 'admin/my-custom-log/delete/' . $flid, array('query' => $query)); The callback...

Published in: #Drupal Planet #ajax #Administration