Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I didn't find an easy way to addres block title to node page.
I would like to have such feature in the future.
Maybe there is something like this but I'm just to tired to find it out?
Comments
Comment #1
joachim CreditAttribution: joachim commentedBest way I think is to wrap the $block['subject'] in a link within nodeblock_block.
But then you're doing it for all nodeblocks.
Comment #2
zroger CreditAttribution: zroger commentedThis is the same as for any block. If you need to override block output, you can use one of the many available block templates.
See http://api.drupal.org/api/function/template_preprocess_block/6
You can use:
- block-[region].tpl.php
- block-[module].tpl.php
- block-[module]-[delta].tpl.php
Comment #3
joachim CreditAttribution: joachim commentedSure, but by the time we get to the block template, we only have subject and content which are strings -- the node nid is no longer available.
Comment #4
tom_o_t CreditAttribution: tom_o_t commentedsee related request in http://drupal.org/node/552536
Perhaps the solution is to add the node object to $block so that it's available to the template?
Comment #5
Johnny vd Laar CreditAttribution: Johnny vd Laar commentedI've added an improvement in the Drupal 7 version. I won't include this in Drupal 6:
http://drupalcode.org/project/nodeblock.git/commit/5afcb66
Comment #6
Johnny vd Laar CreditAttribution: Johnny vd Laar commentedComment #8
klonos@Johnny vd Laar: sorry, I cannot find how to do that. Is there any option somewhere in the UI I'm missing?
Comment #9
Johnny vd Laar CreditAttribution: Johnny vd Laar commentedNo there is no UI option to do this. Inside the block.tpl.php and the preprocess_block you now have the node object such that you can create a link there (code wise).
Creating links from the UI is not something I'm planning to add to this module because the block template is not part of this module.