[development] how to implement hook_views_data() and add a field?

Ken Rickard agentrickard at gmail.com
Wed Jan 7 23:25:15 UTC 2009


I think you want a custom field handler. Check the handlers section of
the Views API.

See, for example, http://drupal.org/node/349178

/me stops pimping his patch now.



On Wed, Jan 7, 2009 at 5:55 PM, yi yang <yang_yi_cn at yahoo.com> wrote:
> All I need is just a placeholder. Say, how can I implement a hook to return a static number as a field? Is it possible? Then I can theme it to whatever I want.
>
>
> --- On Wed, 1/7/09, Earl Miles <merlin at logrus.com> wrote:
>
>> From: Earl Miles <merlin at logrus.com>
>> Subject: Re: [development] how to implement hook_views_data() and add a field?
>> To: development at drupal.org, yang_yi_cn at yahoo.com
>> Date: Wednesday, January 7, 2009, 2:07 PM
>> yi yang wrote:
>> > Hi,
>> >
>> >
>> > All I want is just return a number, which comes from a
>> sql query count of my custom table. I want to represent that
>> as a field so I can adjust it's position in the views
>> ui. It doesn't sounds like very hard, right?
>>
>> Views doesn't support doing things like COUNT() in
>> normal operation yet.
>



-- 
Ken Rickard
agentrickard at gmail.com
http://ken.therickards.com


More information about the development mailing list