Taxonomy Block is great. But when I create a block all the anchor tags in my copy get striped out by this chunk of code:

    while ($node = db_fetch_object($nodes)) {
       $x++;
       $content .= '<div id="'. $x .'" class="'. (substr(decbin($x), -1) ? 'flip' : 'flop') .'"><h2>'. l($node->title, 'node/'. $node->nid,  array('title'=>t('view all'))) .'</h2>';
       if($result->teaser) {
         $content .= strip_tags(substr($node->body, 0, $result->teaser) . (strlen($node->body) > $result->teaser ? '...' : '')) .'</div>';
       }
       else {
         $content .= '</div>';
       }
    }

I guess I don't understand why you would want to strip out ALL tags. Could we change it to something like this?

         $content .= strip_tags(substr($node->body, 0, $result->teaser) . (strlen($node->body) > $result->teaser ? '...' : ''), '<a>') .'</div>';

Which would allow anchor tags but still get rid of other stuff?

What do you think?

Comments

crunchywelch’s picture

Status: Active » Closed (won't fix)

You can now override the theme call theme_taxonomy_block_item and change the output however you like, including the teaser generation. I like to have all tags stripped out personall because it takes less time than doing lots of checks to see if I am cutting off an html element in the middle with the teaser, etc.