So I was working on some intense CSS stuff, and came across an issue where I couldn't modify certain CSS elements, and finally I realized it's because the block.tpl.php for PHPtemplate has spaces in the CLASS and ID names.

The new default block.tpl.php should be as follows:


<div class="<?php print "block block-$block->module" ?> " id="<?php print "block-$block->module-$block->delta"; ?> ">
  <h2><?php print $block->subject ?> </h2>
  <div class="content"><?php print $block->content ?></div>
</div>

Hope this helps the next person! :)

--Dave

http://dave.notik.com

Comments

DaveNotik’s picture

Update: Drupal.org itself actually creates those spaces when surrounding with PHP tags... so they showed in my example above as well. Hmmm...

morbus iff’s picture

Status: Needs review » Closed (won't fix)

I coulda swore I already commented on this.

In short, this is not a bug. A CSS class of "two words" does not mean that it's looking for a class called "two words" - it's actually looking for a CSS class "two", and then a CSS class "words", and then merges the two definitions together. It's a CSS feature, not a Drupal bug.

morbus iff’s picture

Status: Closed (won't fix) » Active

Further explanation from DaveNotik in IRC asserts that I had no idea what he was talking about.

morbus iff’s picture

Title: Spaces in CLASS/ID names in block.tpl.php causes issues! » <code> filter in Handbooks introducing erroneous spaces
Project: PHPTemplate » Documentation
Component: Code » Developer Guide

Alrighty:

  • None of the shipped code in Drupal contains this space.
  • The space is being caused, visually, in the book page on block.tpl.php.
  • Copying and pasting this example from the book page causes the problem.

Updating issue to match underlying issue.

add1sun’s picture

Status: Active » Fixed

This appears fixed to me. I don't see the issue anymore (or I don't get it ;)). Moving to fixed. If I'm wrong someone can reopen.

Anonymous’s picture

Status: Fixed » Closed (fixed)