1

In my projects section, each project entry has a Entry field in a Matrix. The Entry field references a tool. On the tool entry page I am trying to display all the projects that use that tool in their Matrix entry field. How do I do that? Currently I use this code but it doesn't display anything. I'm guessing I need to reference the Matrix handle and Entry field handle somehow but I haven't seen it done yet.

{% set relatedProjects = craft.entries.section('projects').relatedTo(entry) %}

{% for project in relatedProjects %}
    {{ project.title }}
{% endfor %}
  • Assuming projectin is just a typo here? – Brad Bell Sep 23 '16 at 0:01
1

I wasn't able to relate the entries back based on another entry using it in a field. I believe there would be a way to do this if you cycled through all of those relating entries and that field and filtered out the ones that matched to current entry. We ended up using categories instead and relations work much better in there!

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.