February 08

Tweet!

@mcrittenden: @Dries did you just discover reddit or something? ;)

Posted 01:45 PM | 0 Comments
February 06

Tweet!

@mcrittenden: Ported my entire blog from Chyrp to Drupal and then finally decided that I'd rather just stay with Chyrp, so I scrapped the whole thing :-|

Posted 07:25 PM | 0 Comments
February 05

The correct way to do login forms

Note: this is one of those opinion pieces that you may disagree with if you like.

There's a right way and a wrong way to do login forms. The right way goes something like this (from the eyes of the user):

  1. User enters username/email
  2. User hits tab
  3. User enters password
  4. User hits tab
  5. User lands on 'Remember Me' checkbox and can check or uncheck. If your login form doesn't have this checkbox, that's ok, just skip this and the next step.
  6. User hits tab
  7. User hits enter to login

This should be the case for 99% of login forms on the web. This way, the user goes in a very specific order (Username -> Password -> Remember me -> Log in), and it's an order that makes sense, because it's a logical progression. You enter your information, you decide if you want the website to save the info you just entered, and finally you submit the form.

What not to do

That's all for now. I'm just a bit tired of having to tab past the submit button to reach the 'Remember Me' checkbox, or accidentally hitting enter on the 'Forgot My Password' link since it's in the wrong place.

Posted 10:59 AM | 0 Comments
February 04

Tweet!

@mcrittenden: Any thoughts on Disqus vs. IntenseDebate vs. others vs. plain old comments?

Posted 11:51 AM | 0 Comments

MarkItUp Module for Chyrp's Markdown

I just released a Chyrp module which implements MarkItUp's Markdown set into Chyrp's admin UI. It's a really simple module and should work with Chyrp's 2.0 release as well as the development releases at GitHub.

I've been using it for a couple weeks and have really enjoyed it. MarkItUp does a good job of finding a middle ground between raw code and WYSIWYG. If you're not familiar with the editor, check out the demos.

Part of the beauty of MarkItUp is that the textarea can stay a textarea since it's still just text. Most WYSIWYGs have to convert it to an iFrame to display bold text, italic text, images, etc., and that tends to get a bit messy and slow.

Anyways, if you're a Chyrp user and you're interested, check out the module. Also, here's a screenshot:

Chyrp MarkItUp Screenshot

Posted 10:34 AM | 0 Comments
February 01

Tweet!

@mcrittenden: WTF? Turns out Velociraptors were only about the size of a turkey and they had feathers! http://en.wikipedia.org/wiki/Velociraptor

Posted 03:47 PM | 0 Comments
January 29

Top 10 tips to a new django developer

Posted 01:57 PM | 0 Comments
January 28

Adding a Custom Token to the Ubercart Email Template(s)

Note: this post is a direct copy and paste from Agile Adam's post. since that page started throwing a 404. Google's cache still had it so I grabbed it and posted it here so it wouldn't be lost forever. If the page comes back up or if Adam gets mad, holler and I'll take this down.

In this post I'll show how to set up an extra token for use in an Ubercart template. This will require creating a custom module (because we don't really want to modify others' modules). We'll use a few different hooks to create the token, and then simply modify the template to include this token. This setup requires the token module (which is required by Ubercart), so make sure this is enabled!

Before diving into this, please make sure you have a Ubercart system that sends emails when orders are placed. You should also have a test account from which you can place orders and receive emails.

1) Create a custom module

Just an empty modulename.module and modulename.info will do for now.

2) Create the Ubercart Template

Template files are in ubercart/uc_orders/templates. You must make a copy of the customer template and name it something unique (must end with .itpl.php). After doing so, you can choose this new template in Ubercart in the Order Settings page. The drop down there should show your new template. This setting is for the on-site invoice template viewing within the Drupal site. To set this template as the email template, you must also edit the conditional action in the Ubercart settings.

3) Add a hook_token_values() to your custom module

This code creates a token containing the last 4 digits of the credit card number used for an Ubercart order. I'll leave it up to you to research any of the code used.

/**
 * Implementation of hook_token_values(). (token.module)
 */
function mymodule_token_values($type, $object = NULL){
    $values = array();
    switch($type){
    case 'order':
        $order = $object;
        if($order->payment_details['cc_number']){
            $values['order-cc-number'] = uc_credit_display_number($order->payment_details['cc_number']);
        }
        break;
    }
    return $values;
}

4) Add a hook_token_list() to show token in list of tokens

/**
 * Implementation of hook_token_list(). (token.module)
 */
function mymodule_token_list($type = 'all') {
    if ($type == 'order' || $type == 'ubercart' || $type == 'all') {
        $tokens['order']['order-cc-number'] = t('The last 4 digits of the credit card number used for the order.');
    }
    return $tokens;
}

You can now see your new token in the list of available ubercart tokens (admin/store/help/tokens)

5) Add the token to your template

Add your token using the following in your template:

[order-cc-number]

6) Clear the Drupal cache and make sure your custom module is enabled.

7) Create an order using an email account you can check. Then, verify that it is working as expected (check the email that is sent, as well as the online invoice.

Please check out the Token and Ubercart APIs for more information! If you have problems, make sure your module doesn't have any errors, and make sure it's being used. Also, verify that your Ubercart system is using the new template!

Posted 01:50 PM | 0 Comments | Tags:
January 27

QUOTE: Just yesterday I was looking at my iPhone thinking "Hmmm, I wish this thing didn't fit in my pocket and couldn't make phone calls." Then I looked over to my netbook and couldn't help but feel it would benefit from losing the keyboard and being made of 50% glass.

Finally apple gives me what I wish.

Source

Posted 08:35 PM | 0 Comments
January 21

An awesome and useful JS Bookmarklet for designers

Posted 04:50 PM | 0 Comments
Page 1 of 28 Next →

WTF?