Difference between revisions of "D7 Theming"

From Things and Stuff Wiki
Jump to navigation Jump to search
Line 14: Line 14:
  
 
* http://drupal.org/node/1089656
 
* http://drupal.org/node/1089656
 +
 +
* [https://www.youtube.com/watch?v=U0kU2nG2gP0 DrupalCon Prague 2013: THE HISTORY & FUTURE OF DRUPAL THEMING]
  
 
== Modules ==
 
== Modules ==

Revision as of 20:33, 3 October 2013

Basics

Modules

  • Code per Node makes it possible to add custom CSS and Javascript per node, per block, and per content type. The code is stored in the database, but served from the file system. It also supports syntax highlighting with CodeMirror.
  • CSS Injector allows administrators to inject CSS into the page output based on configurable rules. The CSS is added using Drupal's standard drupal_add_css() function and respects page caching, etc.
  • JS injector - drupal_add_js() function and respects page caching, etc.

Development

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