[development] Body and teaser as fields
stella at stellapower.net
Wed Feb 11 09:36:33 UTC 2009
Yep, I'm definitely in favour of this. It would make things a lot cleaner
and more usable. So +1 from me.
On Wed, Feb 11, 2009 at 4:20 AM, Barry Jaspan <barry at jaspan.org> wrote:
> Now that Field API is in core it is time to start using it. I have an
> initial suggestion: change node body and teaser from special cases to normal
> fields. I suspect this is going to be quite controversial so I thought I'd
> get some feedback here before evening bothering to start looking at the
> This message is not about the details of the implementation; I'm sure there
> will be subtleties and complexities to work. I'm just asking about the
> Remove all special processing for $node->body and $node->teaser. Create
> two fields, body and teaser, both text fields. Assign both fields to every
> existing content type with a "body field" using the textarea widget. For
> existing nodes, as part of the upgrade path, initialize the teaser field
> value with whatever teaser would normally be generated automatically from
> the body.
> Random thoughts:
> - We will get to remove a bunch of code, much of it quite ugly, from
> - Sites that really want an auto-generated teaser can remove the teaser
> field from a content type and use the text field's teaser Display Formatter
> in the teaser context.
> - This will mean removing the body field from the node and node_revision
> tables, and creating a field_data_body table for it instead. Don't worry
> about database query efficiency; that is a solved problem (see
> - With $node->body and $node->teaser being normal fields, they will not be
> available for overloaded use as the complete rendered output of the node.
> Hurray! We can use $node->content = drupal_render($node) or something like
> - We might want to think about adding other fields to our default content
> types. Perhaps Article should have a Subtitle field, etc. This is a whole
> topic in itself.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the development