By agsparta on
Hi,
I want to grab the nid from an array (for example: array(1) { [0]=> array(1) { ["nid"]=> string(5) "32857" } } ) and load node using node_load.
How do I do that. I am trying but no success.
Thanks,
Ashish
Hi,
I want to grab the nid from an array (for example: array(1) { [0]=> array(1) { ["nid"]=> string(5) "32857" } } ) and load node using node_load.
How do I do that. I am trying but no success.
Thanks,
Ashish
Comments
You likely have a problem in
You likely have a problem in the syntax you are using to get the nid. Let's see what you have tried so we can help you debug.
Thanks
The syntax you are using to
The syntax you are using to load the node is fine, but the if condition will evaluate to TRUE even if there is no reference nid because $node->field_site_node is likely an empty array (it's not NULL but is empty).
When I use
When I use
var_dump($site_nid)it shows string(5) "96599". I want to grab the node is which is 96599.What happens with
What happens with var_dump($site_node) ?
Hey, thanks man. I got it.
Hey, thanks man. I got it. The node loads properly and I was able to use the field values from that external node and show it on the current node.
Can you show your working
Can you show your working code so it helps others?
Sure! Here is my code: <?php
Sure!
Here is my code:
Cheers
Cheers