Deprecated

Drupal for Facebook on D5

Last modified: November 7, 2009 - 00:12

This is where pages specific to the Drupal 5.x version go to die.

Stop using Drupal 5.x. Upgrade to the latest version of Drupal for Facebook. It may not be perfect, but it's much better!

ARCHIVE - Overview of Basic Form Creation in Drupal 6.x

Last modified: May 7, 2009 - 20:10

Basic form creation requires simply calling the function drupal_get_form with the name of a function that will define the form (as a structured array.) The next page in this guide begins the basics of describing how this structured array is written.

Calling drupal_get_form() starts a chain of steps which will be explained in greater detail in the course of this guide. In short, this function acts as both form processor and form renderer, meaning that it contains steps that check if the form has been submitted as well as to render the form (both if it has and it has not been submitted.)

Other steps that the function undertakes are:

  • Form validation
  • Form manipulations that installed modules want to perform
  • Filling in of default values
  • Ordering of form elements according to the "weights" set

... and so on.

5.x (Deprecated/Unsupported)

Last modified: December 17, 2008 - 00:29

Smackdown provides a way to compare two pieces of content to vote upon. It only allows "apple to apple" comparisons, not "apple to orange", meaning that you can only compare two pieces of content that are of the same content type.

Smackdown features

  • Autocomplete form fields for selection of content
  • Taxonomy integration, which essentially limits your autocomplete results
  • A standings page to view results
  • Upon voting, you are redirected to the next Smackdown of the same content type
  • Ability to have your users create more smackdowns

Requires VotingAPI.

This module is great for websites that value high page views as it allows users to view many pages as they keep clicking that vote button.

Developed at Sony BMG in close collaboration with the Lullabots.

Genesis 6.x-1.x Docs (deprecated)

Last modified: October 24, 2009 - 21:13

To create your sub-theme first make a copy of the /genesis_SUBTHEME/ directory.

The best place to save your new sub-theme is: sites/all/themes/

The new sub-theme does not have to be inside the /genesis/ directory, as this is optional in Drupal 6.

The new sub-theme folder contains the following files & directory:

  • genesis_SUBTHEME.info
  • genesis_SUBTHEME.css
  • ie.css
  • page.tpl.php
  • template.php
  • favicon.ico
  • screenshot.png

The Sub-theme Folder /genesis_SUBTHEME/

Change "SUBTHEME" to your theme name e.g. /genesis_mytheme/

genesis_SUBTHEME.info

Change "SUBTHEME" to your theme name e.g. genesis_mytheme.info

Inside the .info file change:

  1. The theme name.
  2. The description.
  3. The stylesheet name to match the name of your theme.

Heres a sample of the code you will see when you open up the genesis_mytheme.info file, you can easily see where you need to change the details.

  ; Change the name, description and stylesheet file name to
  ; match your new themes name.

name          = Genesis SUBTHEME
description  = My Kickn' Sub-theme


  ; Change the Stylesheet name to your themes name. E.g genesis_mytheme.css

stylesheets[all][] = genesis_SUBTHEME.css

The 7 Layouts (6.x-1.x)

Last modified: August 27, 2009 - 02:44

Most themes support only one layout. The Genesis theme is different — it supports seven different layouts, straight out of the box.

View the Setting up the Layout and Width video tutorial.

To change the layout all you need to do is:

  1. Open the page.tpl.php file in your sub-theme (all sub-themes have a page.tpl.php).
  2. Change the body ID selector. For example <body id="genesis_1">, see layout.css.
  3. Save, upload, refresh, done.

Screen shots of all the layouts

The label above each layout is the id selector. This is all covered in great detail in layout.css in the base theme.

Adding an 'auto_increment' field

Last modified: October 2, 2009 - 14:26

There's now a module to do this, Serial Field, I recommend you to use that one instead of this option

This snippet will create an auto increment field. You could use this if you have a content type where you need to register a transaction number and you don't want to let the users add the transaction number because you might lose the sequence.

if (!empty($node_field[0]['value'])) {  // the node is not new
  return $node_field[0]['value'];
}
else {  // the node is new
  $count = db_result(db_query("SELECT COUNT(*) from {node} WHERE type = 'transaction'"));
  $node_field[0]['value'] = $count;
}

In this case the Content Type is 'Transaction' so you'll have to change that to the content type you want to count...

Syndicate content
 
 

Drupal is a registered trademark of Dries Buytaert.