Your current approach is heading towards a world of hurt. Why not just use PHP for your block visibility?<br><br><?php<br>if ($node = menu_get_object()) {<br> return in_array($node->type, array('my-type1', 'my-type2'));<br>
}<br>?><br><br clear="all">Dave Reid<br><a href="mailto:dave@davereid.net">dave@davereid.net</a><br>
<br><br><div class="gmail_quote">On Wed, Jan 27, 2010 at 5:09 AM, Lluís <span dir="ltr"><<a href="mailto:enboig@gmail.com">enboig@gmail.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;">
I have some custom nodes and I need some blocks to appear depending on<br>
node-type.<br>
<br>
My approach to solve the problem was replicate "/node/$nid" behavior<br>
to "/my-type1/$nid" in order to make blocks visible depending on<br>
node-type. If a user entered a view to "/node/$nid" he got<br>
"drupal_goto" to the right url.<br>
<br>
My problem now is that for some node-types /type/$nid works, but<br>
/node/$nid stopped working; any hint? I am completely lost right now.<br>
<br>
== hook_nodeapi ==<br>
.....<br>
case 'view':<br>
if ((arg(0)=='node')&&(arg(1)==$node->nid)) {<br>
switch ($node->type) {<br>
case 'my-type1':<br>
case 'my-type2':<br>
drupal_goto($node->type.substr($_GET['q'],4));<br>
break;<br>
.....<br>
<br>
== hook_menu ==<br>
......<br>
foreach($node_types AS $key) {<br>
$items[$key.'/%node'] = array(<br>
'title callback' => 'node_page_title',<br>
'title arguments' => array(1),<br>
'page callback' => 'node_page_view',<br>
'page arguments' => array(1),<br>
'access callback' => 'node_access',<br>
'access arguments' => array('view', 1),<br>
'file' => 'node.module',<br>
'file path' => drupal_get_path('module', 'node'),<br>
'type' => MENU_CALLBACK,<br>
);<br>
$items[$key.'/%node/view'] = array(<br>
'title' => 'View',<br>
'type' => MENU_DEFAULT_LOCAL_TASK,<br>
'weight' => -10);<br>
......<br>
<font color="#888888"><br>
<br>
<br>
--<br>
*Les normes hi són perquè hi pensis abans de saltar-te-les<br>
*La vida és com una taronja, què esperes a exprimir-la?<br>
*Si creus que l'educació és cara, prova la ignorància.<br>
*La vida és com una moneda, la pots gastar en el que vulguis però<br>
només una vegada.<br>
*Abans d'imprimir aquest missatge, pensa en el medi ambient.<br>
</font></blockquote></div><br>