1

I have a page A that has an inline entity form that is referencing to page B, it's possible programmatically or in another way to get the link address of a file that page A is referencing to?

1 Answer 1

0

Yes it is possible, but that's a quite broad question. And it depends a little bit what exactly want to achieve and where.

Basically when you have the node object of page B you also have the field value of the reference field, which will be a node ID. The node ID of page A. You can take this node ID to load node A – node_load($nid).

Then you have the node object of node A. And from there you'll get the field value of the file field which most likely is a file ID. This file ID now can be taken to build the path to the file – file_load($fid).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.