Yeah, context module. It's beta right now, but it works well (it's a Dev Seed beta, so it's pretty high quality =P )<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 Wed, Jan 27, 2010 at 8:57 AM, Lluís <span dir="ltr"><<a href="mailto:enboig@gmail.com">enboig@gmail.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;">
To tell de truth: I didn't know about menu_get_object(). I have some<br>
views where blocks must be shown also; I suppose I could use arg()<br>
there to check the root of the path.<br>
<br>
And about "Context"; I suppose you mean the module. I hadn't heard of<br>
it, but all versions are beta or alpha....<br>
<div><div></div><div class="h5"><br>
On Wed, Jan 27, 2010 at 4:13 PM, Cameron Eagans <<a href="mailto:cweagans@gmail.com">cweagans@gmail.com</a>> wrote:<br>
> Why don't you just use Context?<br>
> -----<br>
> Cameron Eagans<br>
> Owner, Black Storms Studios, LLC<br>
> <a href="http://www.blackstormsstudios.com" target="_blank">http://www.blackstormsstudios.com</a><br>
><br>
><br>
> On Wed, Jan 27, 2010 at 4:09 AM, Lluís <<a href="mailto:enboig@gmail.com">enboig@gmail.com</a>> wrote:<br>
>><br>
>> 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>
>><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>
><br>
><br>
<br>
<br>
<br>
</div></div>--<br>
<div><div></div><div class="h5">*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>
</div></div></blockquote></div><br>