Closed (fixed)
Project:
Content Construction Kit (CCK)
Version:
6.x-1.x-dev
Component:
nodereference.module
Priority:
Critical
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
23 May 2006 at 17:07 UTC
Updated:
29 Jun 2007 at 11:47 UTC
Jump to comment: Most recent file
Comments
Comment #1
ashtonium commentedPersonally, I was hoping that this was what nodereference did when I first experimented with it.
Comment #2
yched commentedI think it might be useful to pass the type of the node whose node reference field you're viewing, along with the node object itself ?
You might want to theme the referenced nodes differently for diferent content types
(not sure that info is available in nodereference_field_view_item(), though)
Comment #3
karens commentedWe definitely need the content type. I forgot about that one, but if you send the whole node you'll get the type, too.
Comment #4
yched commentedKaren : not sure i was clear
I meant passing to the theme function the type of the node having the reference (left side of the 'relation'), along with the referenced node itself (right side)
maybe that is what you understood...
I have a hint that we might need to define a vocabulary here :-)
Comment #5
karens commentedAha, no I did not understand you. It sure is confusing keeping 'referenced' and 'referenced by' nodes straight. Yes, I agree that the content type of both needs to go to the theme because it could make a difference in how the data should be presented.
Comment #6
David Lesieur commentedGood idea! We could pass the $field to the theme function. It has a 'type_name' member which is the type of the node containing the field.
Comment #7
David Lesieur commentedHere's the small patch. If this gets committed, I'll update the patch in http://drupal.org/node/60756.
Comment #8
David Lesieur commentedComment #9
StevenSokulski commentedI'm a bit lost in terms of how to implement this. Could somebody throw together a quick step-by-step on how to make this thing work. I've already got the patch in place but unsure how to use it.
Comment #10
David Lesieur commentedPlease do not hijack feature requests into support requests. We can never get the thing committed if it is filed as a support request.
This patch adds a new theme function. Theme functions can be overridden in your theme. You can find how to do this in the handbook. See here and there.
Comment #11
sunI've been working on this feature, too. IMHO it doesn't make sense to only theme a referenced node. Each content type needs its own styling. I'd like to propose a new option for each node reference to select whether the referenced node should only be listed (default) or completely loaded into the cck node object.
This was the solution for me. It could be extended to select which fields of the referenced node type should be loaded in the future.
Attached patch integrates this option into nodereferences.module which needs a slightly customization of content.module.
Comment #12
sunSorry, don't have enough time now - this reworked patch includes the patch for nodereference backlinks (node referrers).
It loads the referenced node object always, since this would be done twice otherwise.
Comment #13
alex_b commentedThis small patch makes use of hook_field_formatter().
It allows you to chose on the Display fields tab wether you want to reference a node by showing the plain title, the linked title, the node teaser or the node body.
You can chose different presentation types for the teaser and the body view of the embedding node. E. g. you can show the teaser of the embedded node in the teaser view of the embedding node and you can show the full node view of the embedded node on the full node view of the embedding node.
It also passes the $field variable to the theming layer, which opens additional theming options on embedded nodes in node.tpl.php.
I rolled this patch against the latest DRUPAL-5 version of nodereference.module (r1.39.2.12).
alex
Comment #14
appel commentedSubscribing.
Comment #15
mcreature commentedSubscribing.
Comment #16
sunPatch in #13 looks solid and clean to me. If that one works, I'd go for that - didn't have the time to test yet.
Comment #17
yched commentedLooks ok - the only thing that bugs me is the
$referenced_node->field = $field;part - not exaclty sure why, but I'm kind of reluctant... I'll try to give it a closer look.Comment #18
yched commentedAlso look http://drupal.org/node/91792 for a more general discussion about this - views output is definitely the way to go, but the implementation is still not resolved.
Comment #19
guardian commentedsubscribing
Comment #20
ktnk commentedHi,
In order to finalize my site structure, I need to try out the patch above (http://drupal.org/node/65133#comment-191144)
Will it work with my current version of nodereference.module,v 1.39.2.17 2007/03/05 ?
Will this patch be updated for the the latest release? Rolled in to the next cck release?
Should I just replace my nodereference.module file with your patch and run update.php?
Please answer asap,
thanks,
ktnk.
Comment #21
alex_b commentedktnk,
Is actually an interesting question wether the patch in #13 is still applicable - give it a go:
http://drupal.org/patch/apply
Comment #22
yched commentedI committed a slightly reworked version of #13.
It adds both 'referencing_node' and 'referencing_field' properties to the referenced node before rendering. Not sure where we should document this feature, though.
Comment #23
(not verified) commented