I have added a custom block to my users' profile page that shows a list of all that user's submissions. I would like the title to be the user's name then projects so for the user Mike I would like to see "Mike's Projects" as the block title. Is there a way to do this?
If you don't like to get dirty with PHP code than you can install Token Filter module, hide the title (add <none>
in the title field) and create your title in the content of the block wrapping it in a tag. The new title would be like this: <h2>[user:name]'s Projects</h2>
If you're familiar with Drupal's hook system, you can do this via hook_block_view_alter
You can do this thing with block.tpl.php in theme .$block->subject
if ($block->module=block && $block->delta='Your block ID' ){
print 'company name' }
else {print $block->subject;}
your block id ==click in config in block section in admin and you can have the block id in url at end
s quite easy and is the usual way one would attack this, but I am curious as to if it can be done on php code through the block admin interface? , I assume one very ugly hack that would work would be simply using hook_block_view_alter with an existing module, thereby 'hijacking
the hook for that particular block. Example: function block_block_view_alter() would hijack the use of blocks hook. Still. Don
t do this. Good-luck – stefgosselin Feb 2 '12 at 7:04