Posted by Catalyst5 on October 18, 2010 at 12:45pm
Is it possible to use php to reference another node using a field inside this node?
The field contains the title of the other node - not the nid of the other node.
Is it possible to use php to reference another node using a field inside this node?
The field contains the title of the other node - not the nid of the other node.
Comments
Nobody
Nobody knows how to do this?
Cmon guys
Any syntax help here please???
One way
There is an action 'Populate CCK field' that can be used for setting a node reference field. The problem here is that the field stores a node ID, not the title of the node (though often it is the title that is displayed).
You could do what you want in a fashion similar to this:
The most tricky part here is of course the last step. It is definately feasible, but before going down this track I recommend that you consider changing the architecture intestead. Could the textfield with node titles as strings be changed to a regular node reference field?
Good luck!
//Johan Falk, NodeOne, Sweden
Change architecture
Hi Itangalo
Thanks for your idea.Just to clarify - When you say "A view that takes a string as an argument" did you mean a rule set?
As for changing the architecture - No, I cannot change it, as the nodes are imported using an XML feed, so there is no way for me to reference one to another, even though I know the title / id / taxonomy of the other node :(
If you could expand on your idea that may work... I just don't understand how to do it