I have several situations where I want to be able to pull in fields from other nodes via CCK. I've written a patch to nodereference.module which allows users to select fields to display on a per-content type basis. I'm not sure if this is the best approach, but it's working for my needs. Any suggestions would be appreciated :).

One question I had was how to properly add the fields once they have been found. I'm currently doing the output in nodereference_field_formatter, but I think that manually inserting the <br /> isn't the best method.

Thoughts I've had for features which I'd consider doing if this was going to be merged in:

  • Allowing shared fields to be only shown within specific referenced content types.
  • Selecting the fields on a per-node and not a per-content-type basis. This brings up issues of consistency though.
  • Somehow actually storing the referenced fields within the node, so they can be rendered in a simpler manner.

--Andrew

CommentFileSizeAuthor
field_display.patch2.5 KBdeviantintegral

Comments

moshe weitzman’s picture

this is pretty interesting. in addition to render time, i've needed the referenced fields at node_load time. for example, they might be needed in a computed_field. subscribe

mshaver’s picture

I'm in need of this same functionality, but it looks like the original patch was to an earlier version? In my 4.7 template.php file I had modified the "theme_nodereference" function to get this. With this gone in 5.x versions, I'm not sure where to start. I could modify the teaser to display the fields that I would like, but that changes the teaser everywhere, which I'd rather not do. I'm more interested in how the nodereference displays within another node or in a view.

Any ideas?

moshe weitzman’s picture

this is going to be made possible by Views 2.

deviantintegral’s picture

Status: Needs review » Closed (fixed)

FYI this patch doesn't apply cleanly against 1.6 (It's for 1.5). My client changed their mind and they don't need the feature anymore, so I haven't bothered to update this. If this functionality is going to be in Views 2 then that's all I need to hear :).

I'm marking this as closed.

--Andrew