[development] Get all node fields?

Chris Johnson cxjohnson at gmail.com
Mon Sep 14 02:55:04 UTC 2009

Can someone suggest a way to get get a list of user-editable* fields
in a node of a given content type?  I'm trying to write a module which
will set field defaults in nodes being created by Feed API --
including fields which do not exist in the feed, hence I need to know
what's in the node, not what's in the feed.

It also has to be different _per feed_, hence I can't just go by
content type -- not that that is any easier.

*By user-editable, I mean the actual data fields, not the meta-data
fields.  I don't want to mess with things like nid, vid, type, uid,
status, etc.  Rather, just any field which any module (e.g. CCK) might
have added to a basic node to create a new content type.  Obviously, I
can look at the node object, but it's very flat; there's no way to
tell user data from meta-data attributes.

Calling content_fields() will get me the CCK-added fields, I think (I
worry about the date module...).  And I can hard-code the basic core
node fields, if I have to.  But I'd prefer a general solution.

Advice?  Ideas?


More information about the development mailing list