I want to grab all entries that are related to an entry but with the following criteria:
- Only from my section ($section)
- Only the ones that have been added to a certain field ($fieldId)
I currently have this:
$criteria = craft()->elements->getCriteria(ElementType::Entry); $criteria->section = $section; $criteria->limit = null; $criteria->relatedTo = array( 'targetElement' => $element, ); $elements = craft()->elements->findElements($criteria); return $elements;
But if I add two relationship fields to an entry, this will return ALL the associated entries from either field. I want to limit it to just the entries attached to the one field.
Is this possible? Does the question make sense? :-)