Reuse nodereference field formatters
edrex - August 29, 2007 - 18:30
| Project: | NodeReferrer |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Jump to:
Description
"full" and "teaser" formatters have recently been added to nodereference. Rather than copy them, I created a patch that simply reuses nodereference's formatters. This is one step towards merging nodereferrer into nodereference, which I think should be our eventual goal.
Depends on http://drupal.org/node/139283
| Attachment | Size |
|---|---|
| noderef_formatters.patch | 1.1 KB |

#1
Can you explain the reasoning behind not copying the code? Are formatters for both receiving the same data structures? Will it remain that way? Can you think of any reason it may change?
#2
Just tested the patch. Works for me!
It seems to make sense to use nodereference's formatters. Actually, the only difference between nodereference and nodereferrers is that only the former owns the relationship. The rest is about handling the display of a node at one end of that relationship. At both ends of the relationship, what the formatter deals with is a node, and I don't see any reason for this to change.
Extra benefit from this patch: Consistent naming of the display options for both modules.