4

I have a content type that has a unique field. How can I load a specific node based on this? node_load() only takes the nid. I am using Drupal 7.

0
4

There is indeed an API function: EntityFieldQuery, which has lots of example use cases scattered around this site.

0
2

Run a query against the database to find the node that has the field with the specified value and return the nid. Then run the nid through node_load()

1
  • Thanks, was just wondering if there was an API for that.
    – Kevin
    Jul 14 '11 at 16:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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