Active
Project:
Formatter Selector
Version:
6.x-1.1
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
14 Jan 2010 at 16:33 UTC
Updated:
19 Jan 2010 at 11:38 UTC
Can one use formatters in other formatters. This sounds strange so let me exemplify that:
I've a node with lets say 5 references to other nodes, with different formatters. Those 5 nodes also got references to other nodes with formatters. However, I don't really get how I can get the view of the second reference.
The first reference gives me a 4 elements array with the view string. The second reference only gives me a nid.
... (Array, 4 elements)
nid (String)
#delta (Integer)
view (String)
empty (Boolean)
Comments
Comment #1
EmilOberg commentedPlease disregard everything above. I'm claiming temporary coffee loss or something like that ;)
My problem is: When I'm using node_load(), I'm not getting any formatters.
When I'm doing: dsm(node_load(1)), I'm getting:
Where I want to get
How can this be solved?
Comment #2
ndeschildre commentedNot sure I understand well, but first:
aef_utilities_preview_formatter($node, $formatter_name)
you give a node, and a CCK nodereference formatter name, and you get the node theme with the given formatter. Very useful.
So if you have a node A that contains noderef with formatter selector that points to others node B which themselves contains noderef with formatter selector:
For node B, make a formatter that output the field_noderef[0]['view']
For node A, make a formatter that output the field_noderef[0]['view'], having the formatter above selected.
That should simply make it.