Hi,

I'm running Drupal 5.x on the localhost of a Windows XP machine.

Working with a fresh Drupal 5.x install with a little dummy type, I copied my valid .XHTML and .CSS files into a copy of the Zen folder, renaming the index page to page.tpl.php; I then added the some .PHP variables.

When I launch Drupal, and choose my theme, it calls the content, but appears to not call my style. (Although I'm running Firefox with the Web Developer plug-in, so I can see it is in fact referencing my .CSS, it's just not applying it.) When I copy the .PHP and .CSS files into their own folder it does apply the style (but obviously not the content.)

<...snip...>
<head>
<title>My Title</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<?php print $styles ?>
<link rel="stylesheet" href="style2.css" type="text/css" media="screen" />
</head>
<...snip...>

I'm only five weeks into Drupal, so I know I'm likely making a simple mistake. Can anyone tell me what I doing wrong?

Thanks!

-NP

Comments

Tistur’s picture

I'm a newbie too, but this may help.

Yeah, I had problems adding css to my page.tpl.php too. I was able to get around it by adding the following to the top of my template.php, though.

// File is in sites/testsite3.localhost/themes/custom.css
drupal_add_css(path_to_theme() .'/../custom.css', 'theme', 'screen',  TRUE);

In did put an import in my page.tpl.php for IE, and this seems to work:

  <?php print $styles ?>
  <!--[if IE ]>
    <style type="text/css" media="all">@import "<?php print base_path()?>themes/ie-fix-ipa.css";</style>
  <![endif]-->
  <?php print $scripts ?>
nonprofit’s picture

Tistur, thanks! -NP

ehtisham’s picture

Thanks this worked for me too.