[support] can i hook a hook?
sebastian
inforazor at gmail.com
Fri Dec 10 04:17:12 UTC 2010
Hi Larry,
Thank you so much for replying to my query.
So if my contrib module doesn't offer an _alter() (and it does not) my
only option is to hack the module? [or worse, use jquery to alter the
output]
The module is question is nodeasblock and the function implements:
nodeasblock_block ($op = 'list', $delta = 0)
It makes theming decisions in it's operation, which I need to alter.
Namely it decides that the $node->title should be:
l($node->title, 'node/'. $node->nid)
I need to strip the <a href> since I don't want my block to be clickable
and lead to itself.
In other words:
'subject' => l($node->title, 'node/'. $node->nid),
will just become
'subject' => $node->title,
I can hack the module, but that seems like a "no-no"
Thanks!
Sebastian.
On 2010-12-09 8:04 PM, Larry Garfield wrote:
> Some hooks that offer definitions, like hook_menu(), will have a corresponding
> alter hook like hook_menu_alter(). There is no alter hook for hook_block(),
> though. That said, there is an alter hook for all forms, hook_form_alter().
> So if you're manipulating a form you may be able to do so that way.
>
> --Larry Garfield
>
> On Thursday, December 09, 2010 9:22:48 pm sebastian wrote:
>> Hello,
>>
>> Having a terrible time finding anything about this, and all I can find
>> on Drupal.org is the API for hooks, which doesn't really explain enough.
>>
>> My question is, if there is a contrib module with an implementation of:
>>
>> hook_block()
>>
>> such as:
>>
>> nodeasblock_block()
>>
>> How can I change the values inside of this function, without changing
>> the function directly?
>>
>> can I write something in template.php to catch the nodeasblock_block
>> hook and then change the values in it?
>>
>> Or do I need to change the nodeasblock module directly? perhaps adding
>> the feature as a full blown check box addition or just hack it??
>>
>> Thanks for any help you can provide me!
>>
>> kindly,
>>
>> Sebastian.
More information about the support
mailing list