The module works generally for me, but in some cases the HTML code is printed out, which makes it look like:

<h2 class="title">
      <a href="<link>">&lt;a href="<link>" class="block-title-link"&gt;<block-title>&lt;/a&gt;</a>
</h2>

block.tpl.php looks like this:

<div id="block-<?php print $block->module . '-' . $block->delta; ?>" class="<?php print $classes; ?>"><div class="block-inner">

  <?php if ($block->subject): ?>
    <h2 class="title">
      <?php
        if ($block->title_link){
          print l($block->subject, $block->title_link);
        } else {
          print $block->subject;
        }
      ?>
    </h2>
  <?php endif; ?>

  <div class="content">
    <?php print $block->content; ?>
  </div>

  <?php print $edit_links; ?>

</div></div> <!-- /block-inner, /block -->
CommentFileSizeAuthor
#8 block-titlelink-html-792742-8.patch956 bytesngmaloney

Comments

NidSquid’s picture

Exact same problem here. Problem appeared on Friday after upgrading to the version 6.x-1.5, running on Drupal 6.16. Also running a few custom block templates that use the same code that OP posted above.

ngmaloney’s picture

Assigned: Unassigned » ngmaloney
Status: Active » Closed (works as designed)

Hello,

Per several requests, I modified how the link gets rendered. The module no-longer requires a separate block.tpl.php. Simply output the $block->subject in your template file. You can now use a default block.tpl.php.

Feel free to DM or Gchat (ngmaloney at gmail) and I can provide assistance.

walkero’s picture

I have the same problem. If the title has & in it then it shows it as it's html equivalent. But I did a workaround.

change line 73 of block_titlelink.module to:

$vars['block']->subject = l($vars['block']->subject, $title_link, array('attributes' => array('class' => 'block-title-link'), 'html'=>'true'));

So now it gets the html code in the title and shows it right.

grasmash’s picture

Version: 6.x-1.x-dev » 6.x-1.5
Status: Closed (fixed) » Closed (works as designed)

that's less of a workaround and more of a fix. thanks, that should be committed!

ngmaloney’s picture

Status: Closed (works as designed) » Active

I will test and add to module. Thanks for the contribution.

alexgreyhead’s picture

Status: Active » Reviewed & tested by the community

#3 (http://drupal.org/node/792742#comment-3213084) works perfectly for me too - thank you Walkero.

yan’s picture

Version: 6.x-1.5 » 6.x-1.x-dev

Looks like rtbc...

ngmaloney’s picture

Status: Reviewed & tested by the community » Patch (to be ported)
StatusFileSize
new956 bytes

Enclosed is patch. Will push out a release shortly.

ngmaloney’s picture

Status: Patch (to be ported) » Fixed

Patch applied and committed to release 6.x-1.6

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Status: Closed (works as designed) » Closed (fixed)