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