Drupal 7

PHP - Associative Arrays

Drupal loves arrays.  To maximize your Drupal coding, you need to understand arrays, specifically associative arrays.

A typical php array is coded like this:

$LearnTheBlueDrop = array('website', 'drupal', 80, 'Gary Coleman');

As you know, each memory slot in the array is accessed via a numeric index.   If you were to print the value of the second index

Theming - .info file

The dot info file in your theme is the most critical file there is.  This file tells Drupal that your theme is there and informs Drupal about the basics of your theme.  The naming convention is the name of your folder dot info.  If you created a theme, and the directory is called, bluedroptheme, you will need to name your dot info file, bluedroptheme.info

Theming - Structure

When creating themes, you must understand the structure for your theme.  All themes reside in the sites/all/themes/ 

Your theme will reside in a folder within the themes folder, sites/all/themes/YOURTHEME.  Within your theme directory, you will place all your css, js, images, and drupal dependent files like the .info , and template pages.

Themes can not start with a number.  You can not name your theme:  55nuns or 343GaryColemans.  It must start with a alphabetic character!

 

Private Files

There are two types of files in Drupal, Public and Private.  Public files, like the files uploaded to your site are public files.  These are files that available to anyone that knows the URL.

If you do not want to make a file public, make it private!

To configure private files, navigate to admin > config > file system or admin/config/media/file-system

Blocks and Regions

The placement of blocks is defined by your theme, and to see the how they will display, Drupal has a nice utility.

If you are having issues visualizing your blocks and how they display on the region go to your blocks page at: admin/structure/block

Near the top of the blocks page, there is a link to demonstrate block regions (THEME).  Click that link.

Cron

Cron is a time based UNIX scheduler, and Drupal has its own cron!

Drupal's cron is a bit different from UNIX cron, because it does not involve the system cron.
Since Drupal is a scripting application, it does not reside in memory permanently.    When a page is requested via a Drupal site and the request is served, at the end of the request, Drupal checks to see when cron was last run.  It is has been a while, it runs cron.

Pages