I don't recall if there is a cleaner way to do this in Drupal 5, but as a kludge in your 'view' case you could check the path and only return the block array if you are on an admin page.<br><br>For example:<br>
<br>case 'view':<br> $blocks['subject'] = t('Create email contacts');<br> $blocks['content'] = t('My email contact content');<br> if (arg(0) == 'admin') {<br> return $blocks;<br>
}<br><br><div class="gmail_quote">On Wed, Jan 27, 2010 at 1:18 PM, ktt <span dir="ltr"><<a href="mailto:kestutis98@yahoo.com">kestutis98@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thank you for exact answer.<br>
I use DRUPAL 5.21, and it seems, this option<br>
isn't available:<br>
<a href="http://api.drupal.org/api/function/block_example_block/5" target="_blank">http://api.drupal.org/api/function/block_example_block/5</a><br>
<br>
My code didn't work for admin/* :<br>
<br>
function EmailM_block($op='list' , $delta=0, $edit=array()) {<br>
switch ($op) {<br>
case 'list':<br>
$blocks[0] = array(<br>
'info' => t('Example: EMAIL M'),<br>
'status' => TRUE,<br>
'weight' => 0,<br>
'visibility' => 1,<br>
'pages' => 'admin/*',<br>
);<br>
return $blocks;<br>
case 'view':<br>
$blocks['subject'] = t('Create email contacts');<br>
$blocks['content'] = t('My email contact content');<br>
return $blocks;<br>
}<br>
<br>
}<br>
<br>
Regards,<br>
Ktt<br>
<br>
--- On Wed, 1/27/10, William Smith <<a href="mailto:william.darren@gmail.com">william.darren@gmail.com</a>> wrote:<br>
<br>
> From: William Smith <<a href="mailto:william.darren@gmail.com">william.darren@gmail.com</a>><br>
> Subject: Re: [development] Block visibility only in module pages<br>
> To: <a href="mailto:development@drupal.org">development@drupal.org</a><br>
> Date: Wednesday, January 27, 2010, 6:44 PM<br>
<div><div></div><div class="h5">> Yes, you should be able to do this from the<br>
> module code. See the block_example code at <a href="http://api.drupal.org/api/function/block_example_block/6" target="_blank">http://api.drupal.org/api/function/block_example_block/6</a><br>
><br>
><br>
> Note the 'pages' array element (in the example code<br>
> it is specified as 'node/*'). In your case, you<br>
> would want to set this to 'admin/build/modules'<br>
><br>
> Best,<br>
> William<br>
><br>
><br>
> On Wed, Jan 27, 2010 at 11:33 AM, ktt <<a href="mailto:kestutis98@yahoo.com">kestutis98@yahoo.com</a>><br>
> wrote:<br>
><br>
> Hello,<br>
><br>
><br>
><br>
> Is it possible to define block to show only in module<br>
> pages?<br>
><br>
> I would like to define that in module code - is it<br>
> possible?<br>
><br>
><br>
><br>
> Thank you in advance,<br>
><br>
> Ktt<br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
<br>
<br>
<br>
</div></div></blockquote></div><br>