[support] How to disable a wrong block when the site doesn't work

Jason Flatt drupal at oadaeh.net
Sat May 19 18:38:00 UTC 2007


On Saturday May 19 2007 6:13 am, Stefan Borchert wrote:
> Albert Cuesta schrieb:
> > Michel
> >
> > I did as instructed and it worked. Many thanks!
>
> There is an easier way to do this: create an extra directory within
> [your-drupal-inst/includes]. Lets call it "custom". Then create a new
> php-file called "my-custom-block.php". Create a new block, set the input
> type to "php" and insert the following code as content:
> <code>
> <?php
> require_once(dirname(__FILE__).'/includes/custom/my-custom-block.php');
> ?>
> </code>
>
> Now you can modify the new php-file and if there is an error its easy to
> edit this file without modifying any database record.
>
> hth,
>
>   Stefan

Actually, if you have a properly constructed module (which is a PHP file and a 
couple of supporting files), you can just call the function.  And if you are 
doing different custom code things in different places, you can create your 
various functions in the one file and call them as necessary in blocks, nodes 
or whatever, like so:

<?php
  show_me_the_money();
?>


-- 
Jason Flatt
http://www.oadaeh.net/
Father of Six:  http://www.flattfamily.com/ (Joseph, 13; Cramer, 11; Travis, 
9; Angela; Harry, 5; and William, 12:04 am, 12-29-2005)
Linux User:     http://www.kubuntu.org/
Drupal Fanatic: http://drupal.org/


More information about the support mailing list