1-866-277-9958

Articles

At LevelTen, we practice what we preach - but thanks to the ravages of caffeine and late nights, we don't always remember. Thankfully, we have this to remind us.

Theme node body with a template file in the feature

This code can be used to add tpl.php files instead of implementing theme functions to your feature

<?php
 
/**
* Implementation of hook_theme().
* DRUPAL WONT SEE THIS HOOK UNTIL YOU CLEAR YOUR CACHE
*/
 
 
//Create myfeature-node-body.tpl.php in your feature and use $node to theme the node body
 
function myfeature_theme() {
  return array(
    'myfeature-node-body' => array(
      'template' => 'myfeature-node-body',
      'arguments' => array('node' => null),
    ),
  );
}
 
/**
 * Implementation of hook_nodeapi().
 */

Sanitize User Table in Drupal

#!/bin/bash
 
drush sqlq "UPDATE {users} SET pass = md5('pass') WHERE uid > 1;"
drush sqlq "UPDATE {users} SET mail = concat('myaddr+', replace(mail, '@', '_'), '@testdomain.org') WHERE uid <> 0 AND instr(mail, '@testdomain.org') = 0;"

These drush commands will set all users that are not anonymous or user 1 to password "pass" and sanitize all email addresses.

dustinc@getlevelten.com becomes myaddr+dustinc_getlevelten.com@testdomain.org

Adding Customize Dashboard Magic to Your Drupal Theme

If you haven't already tried Open Atrium, you should immediately do so. Once you do, you'll want to put all their cool customize stuff into your website. While the documentation says that it uses context, spaces and features to accomplish their "whiz bang" features, they also use a few theme tricks to bind it all together.

I'm going to show you what is necessary to get your theme ready for the "Customize dashboard" functionality in openatrium.

Internet Marketing Resources [cornerstone draft]

Internet marketing is one of those things - with a little bit of knowledge, you can get far.

On Page SEO
Off Page SEO
PPC
Alternative PPC
Social Media
Blogging
Digital Media Buys

The Ultimate Drupal SEO Module Directory

Back in 2008, when LevelTen made the official switch to only supporting the Drupal CMS, one of the primary factors in our decision making was the marketing capabilities that Drupal provided. From a purely search engine optimization standpoint, Drupal was (and still is) heads and shoulders above other open source content mangement systems. Why is Drupal so much better?

  1. Great coding.
  2. Ease of content creation.
  3. Modular functionality.

Great Coding

How to add Yahoo! Tracking Code to your Drupal Site

More and more of our clients are wanting to track their site metrics from more than just google and since there aren't really any great modules for adding the Yahoo! tracking code; I thought I'd share exactly how I went about adding them. The problem is that if I simply place the tag on the page.tpl.php file then I get the code going site wide and if it's a conversion code, I only need it to trigger for certain pages. We tried creating individual pages and then placing the code in the body, but the problem is the Yahoo! code must be placed into the tags.

Color 101

A very important element in building a website is color. Naturally, people connect certain colors with different emotions and feelings. People of the world see color differently. This is because tradition, religion, and symbolism affects how people feel about color. In order to create a good user experience it is very important that your palette is reflected to your audience.

First, let’s look at a few dominant colors and how they can evoke different emotions.

Drupal errors "Notice: Undefined index: profile in..."

Solution: 

Ah the joy of procedural programming in a weakly typed language.

There are two issues here:
1. Drupal is reporting notices
2. Datastructure mismatches

The particular above notice is created when php tries to access a index of an array where the variable is not holding an array. In general this notice will not cause problems with Drupal functionality. You may want to turn off php reporting notices. To do this you can change php's error reporting.

In php.ini use:
error_reporting = E_ALL & ~E_NOTICE

In .htaccess user:
php_value error_reporting 2039

How To 301 Redirect Multiple Domains Into One Domain

Problem: 

If you need to do a 301 redirect between multiple domain names, and force all domains to direct to the "www", use the following code in your .htaccess file.

RewriteCond %{HTTP_Host} ^(www\.)?secondary-domain1\.com$ [NC]
RewriteRule ^(.*)$ http://www.maindomain.com/$1 [L,R=301]

RewriteCond %{HTTP_Host} ^(www\.)?secondary-domain2\.com$ [NC]
RewriteRule ^(.*)$ http://www.maindomain.com/$1 [L,R=301]

RewriteCond %{HTTP_Host} ^maindomain\.com$ [NC]
RewriteRule ^(.*)$ http://www.maindomain.com/$1 [L,R=301]

And that's how you would do a 301 redirect between multiple domain names, and force the "www" version of your main domain.  The code above is for a .htaccess file on an apache server.

How do I test a website in IE6 on Windows XP?

For Windows XP, the best way I have found to test a website in IE6, is to create a virtual machine on your PC. You will need two things in order to make this happen:

Syndicate content
Syndicate content

©1999 - 2010 LevelTen Interactive - Dallas, TX