Stoppt die Vorratsdatenspeicherung! Jetzt klicken &handeln! Willst du auch an der Aktion teilnehmen? Hier findest du alle relevanten Infos und Materialien:

Archived entries for theming

Theme Options for WordPress Themes

Auch wenn ich schon länger nicht mehr ernsthaft an WordPress Themes gearbeitet habe ist dieses längliche Posting von Chip Bennett ganz spannend:

This tutorial will attempt to provide examples of current (as of the pending release of WordPress 3.1) best-practice implementation, not merely of the Settings API, but of Theme Options implementation as a whole, including:

  • Registering options in the database as a single options array
  • Initializing default options
  • Creating a single Theme Settings page (with tabs)
  • Defining settings page sections and fields
  • Validating and white-listing user-input form data
  • Adding Settings Page contextual help
  • Enqueueing custom CSS for the Settings page
  • Implementing settings in the Theme template files
  • Enqueueing front-end CSS

Drupal Tutorials

Ich habe gerade eine neue Quelle von Drupal Tutorials entdeckt. Design to Theme veröffentlicht einmal im Monat ein Tutorial, leider ohne RSS, und bietet eine Reihe kostenpflichtiger eBooks an. Der Themenschwerpunkt ist Front End Drupal, aka Theming.

Drupal: Override a Views Field Template from a Module

grayside zeigt wie man ein Views Field template aus einem Modul überschreiben kann. Sehr cool.

<?php
/**
* Implementation of hook_theme().
*/
function custom_module_oa_feeds_theme($existing) {
 return array(
 'views_view_field__view_name__field_name' => array(
 'arguments' => array('view' => NULL, 'field' => NULL, 'row' => NULL),
 'template' => 'views-view-field--view-name--field-name',
 'original hook' => 'views_view_field',
 'path' => drupal_get_path('module', 'custom_module') . '/theme',
 ),
 );
}
?>

Converting 6.x themes to 7.x

Eine Übersicht der Änderungen im Theming für Drupal 7 gibt es hier. Da sind eine Menge netter Sachen bei, z.B.:


drupal_pre_render_conditional_comments()

<?php
...
function garland_preprocess_html(&$vars) {
 ...
 drupal_add_css(path_to_theme() . '/fix-ie.css', array('weight' => CSS_THEME, 'browsers' => array('IE' => 'lt IE 7', '!IE' => FALSE), 'preprocess' => FALSE));
}
...
?>

oder Granular rendering in node and user templates, was mein Favorit ist:

<div class="content">
 <?php
 // We hide the comments and links now so that we can render them later.
 hide($content['comments']);
 hide($content['links']);
 print render($content);
 ?>
</div>
<?php print render($content['links']); ?>
<?php print render($content['comments']); ?>. 

daily links

  • Customizing Drupal date field with hook_form_alter and #after_build | Tech Blog by New Leaf Digital | Ben Buckman.net
    I spent a long time today trying to figure out how to customize a Date field in Drupal 6. The field is called field_recurring_dates. I tried everything else I could think of: #process, theme overrides for every element, preprocess, with no luck. The field is generated by a hook_elements inside the Date module, and I couldn't find the equivalent of a hook_elements_alter … until I asked on IRC and got the perfect solution from Fox: the Form API's #after_build callback.


Copyright © 2004–2009. All rights reserved. – Impressum

RSS Feed. This blog is proudly powered by Wordpress and uses Modern Clix, a theme by Rodrigo Galindez.