Drupal 7 General

Books

Drupal 7 Module Building

Drupal Receipes

Rendered page

Make in your module an implementation of hook_menu, specifying the path of your page. Here you can define a function call (e.g. page_call_info()), specifying what and how to render:

# Item of hook_menu
$items['commitchanges'] = array(
    'title' => 'Commit changes',
    'page callback' => 'flat_deposit_ui_view_info',
    'access callback' => TRUE,
    'page arguments' => array(
        'content' => 'Under construction'),

Drupal 7 Theming

Theming is one of the major issues of the drupal framework, particular if you think of this framework as a gigantic wrapper. For sure, Drupal does much more than that, but in the end, what you see is a in HTML-rendered homepage, so it is good to know something about rendering

Render arrays

Render arrays are arrays containing fields that are used to render different content. The most basis type is the markup type, containing with hard coded content. You can specify the output as it is shown on a HTML-page.

'link_upload' => array(
        '#type' => 'markup',
        '#prefix' => '<div>',
        '#markup' => '<a href="/drupal/user/' . $GLOBALS['user']->uid  . '/imce" title="Upload data"><img title="Upload data" alt="Upload data" src="/drupal/sites/default/files/Upload.png"/></a><br/>',
        '#suffix' => </div>')

But there are also a lot of other types. Depending on the type of element which needs to be rendered (e.g. tables) these may have an theme function that can be called to wrap the content of the array in a certain format. An overview of all available functions are here

Videos (google render arrays drupal 7 tutorial):

Pages:

Books:

all the resources mentioned here Books)

Form API

The form api is an important means to interact with the user. You can define for example action buttons and use them to trigger certain events. Normally, this procedure involves several steps.

  1. Create a function containing your form
  2. Call this form from your menu
  3. Create an additional form_validate function
  4. Create a form_submit function

Resources: