HTML5 Base Beta Released

Back at Drupal Camp NYC Jen Simmons pulled a number us Drupal folks together to come up with some solutions for incorporating HTML5 into Drupal. I jumped on to co-maintain the theme aspect.

After much wrangling with CVS I’ve managed to push out a beta release of the HTML5 Base theme for Drupal 6. It’s intended for use as a base theme (hence the name) and for you to build your own theme on top of it.

Replace Taxonomy pages w/ Embed Views

from: http://mustardseedmedia.com/podcast/episode31

  • Create a ‘taxonomy_term_page.tpl.php’ file in your theme.
  • Create a view filtered on a taxonomy term id.
  • Add the following code to the tpl.php file. (adjusted to fit your view))
<?php
  $args
= $tids;
  print
views_embed_view('viewname', 'block_1', $tids);
?>

Taxonomy pages have a default array of term ids that will work as views arguments.


Better Method


Use the theme function on your template.php file

<?php
 /**

incremental classes when grouping multiple cck values in views

By default when you group multiple cck values in a view each item just gets a single ‘field-item’ class. You can’t override this with a simple field formatter or any of the views tpl.php files. The theme function is in contributions/cck/includes/views/content.views.inc (http://drupalcontrib.org/api/function/theme_content_view_multiple_field/6)

My version adds an incremental class to each item that you can use to target specific items. This should go in template.php with “YOURTHEME_” replacing “theme_”


function theme_content_view_multiple_field($items, $field, $values) {

Theming a page by arbitrary content types

from: http://drupal.org/node/223440#comment-1101275

khonggiannet - November 10, 2008 - 12:30

You could improve above code to have the theme suggestion for all content types in your site.

<?php
function my_theme_preprocess_page(&$variables) {
  if (
$variables['node']->type != "") {
   
$variables['template_files'][] = "page-node-" . $variables['node']->type;
  }
}
?>

Now just make your template in form page-node-your_content_type. If it’s missing, the default page template will be used.