An even better practice would be to spend some time upgrading to Drupal 6, and soon! ;)<br clear="all">-----<br>Cameron Eagans<br>Owner, Black Storms Studios, LLC<br><a href="http://www.blackstormsstudios.com">http://www.blackstormsstudios.com</a><br>
<br><br><div class="gmail_quote">On Thu, Jan 28, 2010 at 6:13 AM, ktt <span dir="ltr"><<a href="mailto:kestutis98@yahoo.com">kestutis98@yahoo.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;">
Thank you, it works!<br>
I found, that Drupal recommends to use named arguments with menu callback functions as a better practice:<br>
<a href="http://api.drupal.org/api/function/arg/5" target="_blank">http://api.drupal.org/api/function/arg/5</a><br>
<div class="im"><br>
Regards,<br>
Ktt<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>
</div>> Date: Wednesday, January 27, 2010, 8:47 PM<br>
<div><div></div><div class="h5">> I don't recall if there is a cleaner way<br>
> to do this in Drupal 5, but as a kludge in your<br>
> 'view' case you could check the path and only return<br>
> the block array if you are on an admin page.<br>
><br>
> For example:<br>
><br>
><br>
> case 'view':<br>
> $blocks['subject'] = t('Create email<br>
> contacts');<br>
> $blocks['content'] = t('My email contact<br>
> content');<br>
> if (arg(0) == 'admin') {<br>
> return $blocks;<br>
><br>
> }<br>
><br>
> On Wed, Jan 27, 2010 at 1:18 PM,<br>
> ktt <<a href="mailto:kestutis98@yahoo.com">kestutis98@yahoo.com</a>><br>
> wrote:<br>
><br>
> Thank you for exact answer.<br>
><br>
> I use DRUPAL 5.21, and it seems, this option<br>
><br>
> isn't available:<br>
><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>
><br>
><br>
> My code didn't work for admin/* :<br>
><br>
><br>
><br>
> function EmailM_block($op='list' , $delta=0,<br>
> $edit=array()) {<br>
><br>
> switch ($op) {<br>
><br>
> case 'list':<br>
><br>
> $blocks[0] = array(<br>
><br>
> 'info' => t('Example:<br>
> EMAIL M'),<br>
><br>
> 'status' => TRUE,<br>
><br>
> 'weight' => 0,<br>
><br>
> 'visibility' => 1,<br>
><br>
> 'pages' =><br>
> 'admin/*',<br>
><br>
> );<br>
><br>
> return $blocks;<br>
><br>
> case 'view':<br>
><br>
> $blocks['subject'] = t('Create email<br>
> contacts');<br>
><br>
> $blocks['content'] = t('My email<br>
> contact content');<br>
><br>
> return $blocks;<br>
><br>
> }<br>
><br>
><br>
><br>
> }<br>
><br>
><br>
><br>
> Regards,<br>
><br>
> Ktt<br>
><br>
><br>
><br>
> --- On Wed, 1/27/10, William Smith <<a href="mailto:william.darren@gmail.com">william.darren@gmail.com</a>><br>
> wrote:<br>
><br>
><br>
><br>
> > From: William Smith <<a href="mailto:william.darren@gmail.com">william.darren@gmail.com</a>><br>
><br>
> > Subject: Re: [development] Block visibility only in<br>
> module pages<br>
><br>
> > To: <a href="mailto:development@drupal.org">development@drupal.org</a><br>
><br>
> > Date: Wednesday, January 27, 2010, 6:44 PM<br>
><br>
> > Yes, you should be<br>
> able to do this from the<br>
><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>
><br>
> ><br>
><br>
> > Note the 'pages' array element (in the example<br>
> code<br>
><br>
> > it is specified as 'node/*'). In your case,<br>
> you<br>
><br>
> > would want to set this to<br>
> 'admin/build/modules'<br>
><br>
> ><br>
><br>
> > Best,<br>
><br>
> > William<br>
><br>
> ><br>
><br>
> ><br>
><br>
> > On Wed, Jan 27, 2010 at 11:33 AM, ktt <<a href="mailto:kestutis98@yahoo.com">kestutis98@yahoo.com</a>><br>
><br>
> > wrote:<br>
><br>
> ><br>
><br>
> > Hello,<br>
><br>
> ><br>
><br>
> ><br>
><br>
> ><br>
><br>
> > Is it possible to define block to show only in module<br>
><br>
> > pages?<br>
><br>
> ><br>
><br>
> > I would like to define that in module code - is it<br>
><br>
> > possible?<br>
><br>
> ><br>
><br>
> ><br>
><br>
> ><br>
><br>
> > Thank you in advance,<br>
><br>
> ><br>
><br>
> > Ktt<br>
><br>
> ><br>
><br>
> ><br>
><br>
> ><br>
><br>
> ><br>
><br>
> ><br>
><br>
> ><br>
><br>
> ><br>
><br>
> ><br>
><br>
> ><br>
><br>
> ><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
<br>
<br>
<br>
</div></div></blockquote></div><br>