[development] using variable in node_add callback

Lluís enboig at gmail.com
Tue Sep 8 07:41:18 UTC 2009


On Mon, Sep 7, 2009 at 8:06 PM, John Fiala<jcfiala at gmail.com> wrote:
> It's not that hard, actually.  Just change the 'page arguments' to
> include the value 1.  That means that the value in the 1st segment of
> the url will be passed in as the argument there, and since we (like
> good computer scientists) start counting at 0, that means the %-value
> will be passed to the node_add function.

Its not that easy, node_add() expects just the 'node-type', to it
don't use any other argument. Thats why I am using $_GET['q']
I want to use my parameter in myNodeType_form($node), which is called
by node_add

> You might want to read up on http://drupal.org/node/209056 and the
> sibling pages to it.
>
> On Mon, Sep 7, 2009 at 5:21 AM, Lluís<enboig at gmail.com> wrote:
>> I have added a menu to insert nodes but I need use %variable inside
>> node_form; how could I achieve this?
>>
>>  $items['node/%/pressupost/afegir'] = array(
>>    'title' => 'afegeix', //trans
>>    'access callback' => 'cc_projects_isProject',
>>    'access arguments' => array(1,'create pressupost'),
>>    'type' => MENU_LOCAL_TASK,
>>    'weight' => 10,
>>    'page callback' => 'node_add',
>>    'page arguments' => array('cc_pressupost'),
>>    'file' => 'node.pages.inc',
>>    'file path' => drupal_get_path('module', 'node'),
>>  );
>>
>> thanks
>>
>>
>> --
>> *La vida és com una taronja, què esperes a exprimir-la?
>> *Si creus que l'educació és cara, prova la ignorància.
>> *La vida és com una moneda, la pots gastar en el que vulguis però
>> només una vegada.
>> *Abans d'imprimir aquest missatge, pensa en el medi ambient.
>>
>
>
>
> --
> John Fiala
>



-- 
*La vida és com una taronja, què esperes a exprimir-la?
*Si creus que l'educació és cara, prova la ignorància.
*La vida és com una moneda, la pots gastar en el que vulguis però
només una vegada.
*Abans d'imprimir aquest missatge, pensa en el medi ambient.


More information about the development mailing list