Drupal Droplets: Task One
The setup
Recently, I did some pro-bono consulting work for a client. As part of our agreement I made it clear that I would retain the rights to the code I wrote. The reason I did this is because I wanted to be able to give back to the community, and now I am going to do that. The work was made up of six tasks, ranging from trivial to complex. I intend to write six articles based on these tasks. This is the first.
- Read more
- 135 reads
Button, button, where is the button?
Creating a Rollover Button without Javascript
JavaScript rollover buttons have been a common feature on the web for a long time now, but they do have some drawbacks. In the article below I will describe a way to make some neat looking rollover techniques with just XHTML and CSS. They aren't perfect for every situation, but they are an interesting alternative.
Why not just use MM_swapImage()?
Macromedia's (now Adobe's) ubiquitous JavaScript functions for rollovers are effective but they do have a few disadvantages:
- Read more
- 215 reads
Do You Unit?
What is Unit Testing?
In simple terms, unit testing is a definition of tests to run on your code. Usually, these tests are automated. The "unit" in unit testing means that the tests should test the smallest functional units, like functions or methods. However, unit testing does not have to be limited to only testing small parts; it can also test interactions between parts with complex combinations and variables, and even test some visual elements, like whether or not a certain image is actually shown or if a class was applied to an XHTML tag.
- Read more
- 193 reads
Mixing Conditions and Assignments
Here is another tip from "Mistakes I've Made". Don't mix up your conditions and assignments. In other words be careful about using assignment operators (like the eqauls sign '=') inside of conditional statements. Although this happened with PHP, the same problem can occur with many other languages. Let me explain...
Here is a very common way to loop:
- Read more
- 201 reads
Drupal, webform and Dynamic Checkboxes
Below you will find my description of how I made a new component for Drupal's webform module that dynamically displays a selection of checkboxes. I will go over why I made it. Then I will explain the code step by step. I have also attached a copy of the file for download.
- Read more
- 2084 reads
Drupal, Firefox and the Mysterious Grey Line
Ever since I started making custom themes for Drupal, I kept running into a strange problem. If my theme or my content included a table, when I looked at it in Firefox the table would have a thin grey line on the top. I finally figured out what was causing this and I would like to share it with you.
If you want to skip the lecture, you can click here for the solution.
- Read more
- 641 reads
htmlentities()
Do you need to output a code sample onto an HTML page? Just copy the code into the box below, and press "Convert"
- Read more
- 293 reads
New Drupal "blueprint" Theme for iRolo.net
I finally moved away from the generic Drupal "garland" theme today. This new "blueprint" theme started as an outline for something much more complicated, but I liked it so much I decided to put it up. I plan to make subtle alterations to the template over time, so look forward to little surprises.
- 677 reads
Mambo and "sex"
Recently, I had trouble with the Mambo contact component. Sometimes, the emails would get through, and other times they would not. There did not appear to be any discernable pattern. In the end, I discovered that an innocent looking word in the subject of the email was causing the message to be blocked by some spam filters.
- Read more
- 729 reads
<pre /> Doesn't Do Style
While making the first article in the "Mistakes I've Made" series. I immediately came across the fodder for the next. I was trying to create CSS for my code examples and discovered that using <pre /> just won't cut it anymore.
- Read more
- 408 reads