How to remove title links in blocks

jusspitti - March 13, 2009 - 01:17
Project:Quotes
Version:5.x-1.90
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed
Description

I would like to know how to remove title links in blocks. Thanks

#1

jusspitti - March 14, 2009 - 00:40

I already tried theming the quotes node and the block, but this approach don't cover the nodes displayed in the block.

Any idea?

#2

jusspitti - March 14, 2009 - 01:01

I found the quick solution in the dark side of the force:

in quotes.module find:

if ($block['show_titles']) {
          $quote->content['title'] = array(
            '#value' => '<h3>'. drupal_get_path_alias(l($node->title, 'node/'. $nid)) .'</h3>',
            '#weight' => -100,
            );
        }

and replace it with:

if ($block['show_titles']) {
          $quote->content['title'] = array(
            '#value' => '<h3>'. $node->title .'</h3>',
            '#weight' => -100,
            );
        }

Not elegant but works

#3

NancyDru - March 14, 2009 - 16:22

Ahh, the Dark Side, indeed. Without check_plain, you have opened your site up to XSS attacks.

#4

NancyDru - March 14, 2009 - 16:36
Status:active» fixed

Committed to both branches. It is now a block setting.

#5

jusspitti - March 14, 2009 - 22:43

Thanks this module is great,

I can't find this new option in the quote block, there is a --- Block "View" link text: --- field but entering text or leaving it blank does not make any difference and the titles still have links.

Please advice.

Thanks

#6

jusspitti - March 14, 2009 - 23:10

I imagine something like this should be in the code:

'#value' => '<h3>'. check_plain($node->title) .'</h3>',

#7

NancyDru - March 14, 2009 - 23:19

This will be in the next -dev release. -dev releases roll out at approximately Noon and Midnight GMT.

Yes the code looks like that.

#8

System Message - March 28, 2009 - 23:20
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.