Development

[Drupal] Display separate views on different taxonomy pages (parents/children) using Panels/Views

I have come across the problem a couple of times now and have come across someone else looking for the same things on IRC where you want to have a different view for parent terms and child terms.

Although this probably can be done in Views, I am none the wiser on how to do it and neither were any of the participants on IRC. So my work around is to use Panels taking advantage of Ctools contexts.

This tutorial is written for Drupal 6.

"Disable Drupal blocks/regions" has no effect with some custom themes

I came across a problem with a panels page when I check the "Disable Drupal blocks/regions" box, the sidebars are supposed to disappear so that the content takes the full width. But it didn't work.

Switching back to Garland and the sidebars disappeared as expected. After a quick search, I found this post on drupal.org which is the same issue but one of the replies essentially says to hack core to get it to work, but that is not necessary.

WoW Progression Widget for Wordpress

I have ported the Drupal module of the Word of Warcraft Progression block to be a Wordpress widget.

Programmatically create Ubercart products with attributes and selected options in Drupal 6

I have been working on a import script to import products from a previous custom Drupal module in to Ubercart. For this I have been using the Batch API to handle the large amounts of data. Upon trying to import some products using drupal_execute(), I came to realise that drupal_execute() can not be run in during a batch operation using Batch API.

So I ended up creating the node using node_save() which created the basic product.

Fatal error: Cannot redeclare db_status_report()

The above error message is caused by using 2 seperate database drivers in your settings.php file.

To fix this, make sure you use a single database driver so stick to mysql or mysqli and don't mix the two together.

Javascript Currency Validation

The following will check a string to make sure it is a valid currency. It can only include numbers and a . (decimal point which is optional).

  1. function validateCurrency(amount) {
  2. var regex = /^[1-9]\d*(?:\.\d{0,2})?$/;
  3. return regex.test(amount);
  4. }

How not to create a registration/login process - T-mobile UK

I have just come across a great example of how not to deal with users logging in or registering for a site with T-Mobile (UK).

I am on my second phone with them and had an account with them for the original phone, so I tried logging in using my username which I had in an email and my password. It wasn't having it.

So I tried the forgotten password route. This asked for my mobile number and my username. Entered my original number and username. Nope. Entered my new number and username. Nope.

So I tried the forgotten username + password route. This asks for your name, phone number and email. I entered all this information using my original phone number. Nope. Tried again with my new phone number. Nope.

Block API module changes coming soon

After reviewing and updating Block API for Drupal 7, I saw that there were some fairly big changes made to the way the block system works from a code perspective which meant I have had to change a fair bit of the module for Drupal 7. So rather than having 2 quite distinct bits of code, I will be updating the Drupal 6 version to work like the Drupal 7 version so that the documentation is the same. This not only makes the module easier to maintain from my perspective but also anyone else using Block API.

World of Warcraft - PHP Raider Block

This module adds the ability to have a block pulling out the upcoming raids from PHP Raider.

Download:
ZIP (Drupal 6) Last updated: 2010-07-13 18:30
ZIP (Drupal 7) Last updated: 2011-03-08 18:30

World of Warcraft Blocks for Drupal

I have been working on a site for a World of Warcraft guild to get their frontpage up to scratch with their old site which was running the TinyPortal on SMF. With a server change and some mods becoming unsupported, the decision was made to switch to something else for the frontpage. I had only one thing on my mind which was Drupal. But soon found that there didn't appear to be many modules on Drupal.org for World of Warcraft. So far I have created two blocks using the Block API module I developed and will release more when I have written and tested them. Both blocks are set up in one module, which I have called wow_blocks. If you already have a module called wow_blocks, it may be a bit of a mission getting this to work, so you will have to chose one of the modules.

Download: Downloads can be found on the World of Warcraft Blocks project page.

Updates

2011-01-21 23:30
Added D7 version with the new zones.
2011-01-09 00:35
Added new zones and bosses to progression block.
2010-11-14 09:00
Fixed image paths to work if base_path isn't /.
2010-11-12 19:30
Updated the code for the newest version of block_api.

Pages

Subscribe to Development