D7 Theming

From Things and Stuff Wiki
Revision as of 17:38, 20 November 2012 by Milk (talk | contribs) (→‎Forms)
Jump to navigation Jump to search


Basics

Theme development modules

Backwards compatibility

Layout

Various different methods

Views
Nodequeue
Blocks
Panels
Context
Spaces

Templates

  • etc.

block

<div id="block-<?php print $block->module . '-' . $block->delta; ?>" class="<?php print $classes; ?> "<?php print $attributes; ?>>
  <?php print render($title_prefix); ?>
  <?php if ($block->subject): ?>
    <h2><?php print $block->subject ?></h2>
  <?php endif;?>
  <?php print render($title_suffix); ?>
 
  <div class="content"<?php print $content_attributes; ?>>
    <?php print $content ?>
  </div>
</div>

Forms

For beyond basic content types field layouts;

function milk_form_alter(&$form, &$form_state, $form_id) {
  if ($form_id == 'contact_node_form') {
    $form['actions']['submit'] = array(
        '#type' => 'submit',
        '#value' => t('Send'),
    );
  }
}

Responsive