[development] views2: how to add "link to node" in custom filed
Lluís
enboig at gmail.com
Mon May 4 11:55:01 UTC 2009
I copied it from node.views.inc; I tried using "Node: nid" and setting
it as "hidden", but it didn't work, don't know why.
$data['node_cc_projects']['nid'] = array(
'title' => "Project NID", //trans
'help' => 'Nid del projecte.', //trans
// Information for displaying the nid
'field' => array(
'handler' => 'views_handler_field_node',
'click sortable' => TRUE,
),
// Information for accepting a nid as an argument
'argument' => array(
'handler' => 'views_handler_argument_node_nid',
'parent' => 'views_handler_argument_numeric', // make sure
parent is included
'name field' => 'title', // the field to display in the summary.
'numeric' => TRUE,
'validate type' => 'nid',
),
// Information for accepting a nid as a filter
'filter' => array(
'handler' => 'views_handler_filter_numeric',
),
// Information for sorting on a nid.
'sort' => array(
'handler' => 'views_handler_sort',
),
);
On Mon, May 4, 2009 at 1:34 PM, Victor Kane <victorkane at gmail.com> wrote:
> could you share that code?
>
> Victor Kane
> http://awebfactory.com.ar
>
> On Mon, May 4, 2009 at 7:01 AM, Lluís <enboig at gmail.com> wrote:
>>
>> I solved it adding a "nid" field and inserting it inside the view, but
>> exluding it from visibility.
>>
>>
>> On Mon, May 4, 2009 at 11:01 AM, Lluís <enboig at gmail.com> wrote:
>> > I have created a custom node and now I am addint "views support" to
>> > it. I have a custom field which should be a link to the full node; I
>> > added:
>> >
>> > $data['node_cc_projects']['long_name'] = array(
>> > 'title' => "long name", //trans
>> > 'help' => 'long name of the node.', //trans
>> > 'field' => array(
>> > 'field' => 'long_name',
>> > 'handler' => 'views_handler_field_node',
>> > 'click sortable' => TRUE,
>> > ),
>> > 'sort' => array(
>> > 'handler' => 'views_handler_sort',
>> > ),
>> > 'filter' => array(
>> > 'handler' => 'views_handler_filter_string',
>> > ),
>> > );
>> >
>> > but the link created is "?q=node/" without the node number. What am I
>> > missing?
>> >
>> > 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.
>> >
>>
>>
>>
>> --
>> *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.
>
>
--
*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