PHP

Drupal 4.7 Cheat Sheet

02.22.2006

Stumbled upon this lovely cheet sheet of drupal 4.7 database commands, hooks, sippets php-template variables, ect.

Print one out for yourself!

How to Build the Ultimate Drupal Navigation System

08.09.2005

This is a tutorial on the theory, and methods used to create this site's multi-level top navigation menu. The tutorial covers everything from obscure drupal php fuctions to generate custom dynamic menus, to advanced CSS techniques and practices. Warning: this tutorial will forever change the way you see drupal's navigation, and CSS. That's a promise (so long as you aren't already an expert).

A Practical Tutorial on Drupal's Menu System

08.06.2005

In this tutorial, I will explain how to generate custom menus that are fully controlled from the menu administration page. (path: [www.yourdrupalsite.com]admin/menu). These menus can be enormously useful. The can be used for everything from custom user interfaces, to navigation menus. In addition, since they are hooked into Drupal's core, they can be dynamically updated.

In writing this tutorial, I've assumed that the reader already understands to some extent:

  • Drupal Themes
  • How to copy and paste
  • The value of attempting something for the first time. 

theme_menu_tree() = your new best friend

Alright, we're going to call a php function. O, non-php programmers do not flee in horror. PHP is easy, unless you're paying me, in which case its very difficult.

Using PHP to Dynamically Switch Drupal Themes and Templates

07.18.2005

One powerful trick to improving the way a drupal site flows is switching page templates when certain PHP arguments return true. This is a quick tutorial on how to do that.

Step One: make three copies of page.tpl.php and the name them "frontpage.tpl.php", "admin.tpl.php", and "inside.tpl.php".

Step Two: Open page.tpl.php with an editor. Erase everything.. and I do mean everything, we're building this from the ground up. (get the coffee ready)

Step Three: copy the following code into page.tpl.php:

<?phpif (arg(0) == 'admin') {    include "admin.tpl.php";} if ($is_front) {    include "frontpage.tpl.php";    return;}else {    include "inside.tpl.php";?>

Step Four:Test to make sure that indeed your different templates are

Syndicate content