Sure, but I am also trying to learn how to work with modules. And using "nodeasblock" + views to display the block seems kinda excessive, from a code-simplicity perspective. Note that the new nodeasblock allows my content admin to create a node AND place it in a predefined allowable region all on their own from the node create/edit form; which is very handy. If I then switch over to using views it defeats the point of the UX for the content-admin.<br>
<br><div class="gmail_quote">On Fri, Dec 10, 2010 at 4:37 AM, Steve Kessler <span dir="ltr"><<a href="mailto:skessler@denverdataman.com">skessler@denverdataman.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
>From a different approach you may also just want to do this with views or PHP in a block and then you can customize anything you want without modifying a module. <br><br>-Steve <br><div><div></div><div class="h5"><br>
<div class="gmail_quote">On Fri, Dec 10, 2010 at 2:12 AM, sebastian chedal <span dir="ltr"><<a href="mailto:inforazor@gmail.com" target="_blank">inforazor@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Thanks for your input, a few final questions about this before i give up on trying to be fancy.<br>
<br>1. Is it not possible to "extend" a module with a custom module? Kinda like if I was object programing? Or is hook_alter also required for this?<br>
<br>2. Is there any documentation I can read about making a module able to be altered? What changes need to be made to allow this?<br><br>3. The nodeasblock.module does have several nodeasblock_*_form_alter functions in it, is it somehow possible to preprocess some of these in a theme or in a custom module, to add the new checkbox to toggle the link being an href yes/no, and to then call a different function [from my custom module] to accomplish this?<br>
<br>Even if this last option is not the best solution [since I should probably submit a patch to the module with the new checkbox as part of the module's code], I'm curious to just know IF this is possible; so that when I encounter more complicated problems, where what I need to do isn't necessarily something that anyone else is ever going to want, and I still want to make sure that if the module is updated that my extension to it still (probably) works.<br>
<br>While I appreciate your comment that I could just "leave it" I'm also trying to learn here at the same time the more advanced aspects of drupal at this stage since I am feeling ready for it! At the moment the best solution I have is using PHP at the block-nodeasblock.tpl.php level to do a string replace and strip the a href; but that feels like "wearing a bullet vest" instead of just "getting rid of the gun".<br>
:-)<br><br>Until now I've been depending on a lot of other Drupal people to handle bugs/features when they get hardcore but I really want to get a better understanding for how to modify / extend / hook into and alter modules. It's hard finding a lot of good information on this, so I'm always open to some good links too!<br>
<br>Thanks again!<br>Really appreciated.<br><font color="#888888"><br>Sebastian.</font><div><div></div><div><br><br><div class="gmail_quote">On Thu, Dec 9, 2010 at 8:55 PM, Larry Garfield <span dir="ltr"><<a href="mailto:larry@garfieldtech.com" target="_blank">larry@garfieldtech.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Unfortunately in that case it doesn't look like there's a way in. You'll need<br>
to either hack the module or submit a patch back to the maintainer to make it<br>
more flexible. The latter approach is generally preferred. :-)<br>
<br>
Or just decide that having the link there doesn't actually hurt anything so<br>
it's not worth fussing over. That's also a viable option far more often than<br>
people realize.<br>
<font color="#888888"><br>
--Larry Garfield<br>
</font><div><div></div><div><br>
On Thursday, December 09, 2010 10:17:12 pm sebastian wrote:<br>
> Hi Larry,<br>
><br>
> Thank you so much for replying to my query.<br>
><br>
> So if my contrib module doesn't offer an _alter() (and it does not) my<br>
> only option is to hack the module? [or worse, use jquery to alter the<br>
> output]<br>
><br>
> The module is question is nodeasblock and the function implements:<br>
><br>
> nodeasblock_block ($op = 'list', $delta = 0)<br>
><br>
> It makes theming decisions in it's operation, which I need to alter.<br>
> Namely it decides that the $node->title should be:<br>
><br>
> l($node->title, 'node/'. $node->nid)<br>
><br>
> I need to strip the <a href> since I don't want my block to be clickable<br>
> and lead to itself.<br>
><br>
> In other words:<br>
><br>
> 'subject' => l($node->title, 'node/'. $node->nid),<br>
><br>
> will just become<br>
><br>
> 'subject' => $node->title,<br>
><br>
> I can hack the module, but that seems like a "no-no"<br>
><br>
> Thanks!<br>
><br>
> Sebastian.<br>
><br>
> On 2010-12-09 8:04 PM, Larry Garfield wrote:<br>
> > Some hooks that offer definitions, like hook_menu(), will have a<br>
> > corresponding alter hook like hook_menu_alter(). There is no alter hook<br>
> > for hook_block(), though. That said, there is an alter hook for all<br>
> > forms, hook_form_alter(). So if you're manipulating a form you may be<br>
> > able to do so that way.<br>
> ><br>
> > --Larry Garfield<br>
> ><br>
> > On Thursday, December 09, 2010 9:22:48 pm sebastian wrote:<br>
> >> Hello,<br>
> >><br>
> >> Having a terrible time finding anything about this, and all I can find<br>
> >> on Drupal.org is the API for hooks, which doesn't really explain enough.<br>
> >><br>
> >> My question is, if there is a contrib module with an implementation of:<br>
> >><br>
> >> hook_block()<br>
> >><br>
> >> such as:<br>
> >><br>
> >> nodeasblock_block()<br>
> >><br>
> >> How can I change the values inside of this function, without changing<br>
> >> the function directly?<br>
> >><br>
> >> can I write something in template.php to catch the nodeasblock_block<br>
> >> hook and then change the values in it?<br>
> >><br>
> >> Or do I need to change the nodeasblock module directly? perhaps adding<br>
> >> the feature as a full blown check box addition or just hack it??<br>
> >><br>
> >> Thanks for any help you can provide me!<br>
> >><br>
> >> kindly,<br>
> >><br>
> >> Sebastian.<br>
</div></div><div><div></div><div>--<br>
[ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br>
</div></div></blockquote></div><br>
</div></div><br>--<br>
[ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br></blockquote></div><br><br clear="all"><br></div></div><font color="#888888">-- <br>Steve Kessler<div>Owner and Lead Consultant </div>
<div>Denver DataMan, LLC </div>
<div>303-587-4428</div><br>
</font><br>--<br>
[ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br></blockquote></div><br>