tags:

views:

22

answers:

1

Hi there,

I noticed in the Zen theme there were various PHP files with the .inc file extension .i.e. template.conditional-styles.inc. I've read/watched quite a few theming tutorials but none of them mentioned these files for theming, only the template.php.

Can anyone tell me when, if and how I should be using these files for theming.

Many thanks

+1  A: 

It's for internal using in Zen theme, read comments please in files for what these.
For example, about template.conditional-styles.inc:

// The code for conditional stylesheets started out as a patch for Zen. Now that
// it has been spun out to its own separate module, It would be nice to prevent
// code drift between the Zen implementation and the conditional_styles.module,
// so Zen now includes an exact copy of conditonal_style module's:
// conditional_styles.theme.inc,v 1.4 2008/09/14 23:26:47 johnalbin Exp

It will included in template.theme-registry.inc file, via this code:

function _zen_theme(&$existing, $type, $theme, $path) {
  // Compute the conditional stylesheets.
  if (!module_exists('conditional_styles')) {
    include_once './' . drupal_get_path('theme', 'zen') . '/template.conditional-styles.inc';
    // _conditional_styles_theme() only needs to be run once.
    if ($theme == 'zen') {
      _conditional_styles_theme($existing, $type, $theme, $path);
    }
  }

_zen_theme will included in template.php:

/**
 * Implements HOOK_theme().
 */
function zen_theme(&$existing, $type, $theme, $path) {
  ...
  include_once './' . drupal_get_path('theme', 'zen') . '/template.theme-registry.inc';

Read about hook_theme.

Nikit
Thanks Nikit. I had read the comments in the files but I was still a little unclear hense the question on here. I will read the hook_theme link you listed.Many thanks
Nick Lowman

related questions