Difference between revisions of "D7 Theming"

From Things and Stuff Wiki
Jump to navigation Jump to search
Line 36: Line 36:
 
** Using the Drupal Theme Developer Tool: [http://www.youtube.com/watch?v=0z9FRWPfIOU YouTube: Theming Basics for Drupal]
 
** Using the Drupal Theme Developer Tool: [http://www.youtube.com/watch?v=0z9FRWPfIOU YouTube: Theming Basics for Drupal]
 
** [http://drupal.stackexchange.com/questions/21188/candidate-page-tpl-name-for-particular-custom-content-type-entry Candidate page tpl name for particular custom content type entry] - how to add devel themer override template suggestions in a custom content type.
 
** [http://drupal.stackexchange.com/questions/21188/candidate-page-tpl-name-for-particular-custom-content-type-entry Candidate page tpl name for particular custom content type entry] - how to add devel themer override template suggestions in a custom content type.
 +
 +
=== Favicon ===
 +
* https://drupal.org/project/favicon
 +
* https://drupal.org/project/touch_icons
 +
* https://drupal.org/project/sans_druplicon
  
 
== Backwards compatibility ==
 
== Backwards compatibility ==

Revision as of 05:26, 11 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

Favicon

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