Maintaining a relationship of parent from children selected through entry field Not sure that is the best title but:

I have a Section called Research Projects. An entry from this section contains a number of images, videos and audio entries in a grid chosen through an Entry Field. At the moment when one of the grid items is selected it displays a modal showing the details of that entry. There is no issue is showing a relationship as the info is displayed on the same page.

My question is if I chose to show the entry selected on a new page how would I show the relationship to the page it appears on / came from? Perhaps as a title from the previous page or a back button.

I am not using a structure as video, image items can appear in multiple projects.

Hope that makes sense and thank for any help anyone can offer.

Scott
This is commonly called 'reverse-related entries' and is achievable using relatedTo(). See here for some info... 


  My question is if I chose to show the entry selected on a new page how would I show the relationship to the page it appears on / came from? Perhaps as a title from the previous page or a back button.


For example, if a visitor were on an Audio Entry page, your template code would look something like:

{% set relatedResearchProject = craft.entries.section('researchProjects').relatedTo(entry) %}
{% for researchProject in relatedResearchProject %}
    &lt;li&gt;&lt;a href="{{ researchProject.url }}"&gt;{{ researchProject.title }}&lt;/a&gt;&lt;/li&gt;
{% endfor %}


The above, would display any Research Projects which contain related "audio" Entries.



The logic is as follows:

{% set relatedResearchProject = craft.entries.section('researchProjects').relatedTo(entry) %}



Create a new variable called "relatedResearchProject" (in fact the variable name can be any word which makes sense to you)
The new variable should contain any entries from the Research Projects Section which are related to the the (Audio) entry being displayed on the current page.


Then...

{% for researchProject in relatedResearchProject %}&lt;li&gt;&lt;a href="{{ researchProject.url }}"&gt;{{ researchProject.title }}&lt;/a&lt;/li&gt;{% endfor %}


Loop through and display any entries which are in the 'relatedResearchProject' variable.



In a different example below, you can see that "Third news entry..." contains the Entry field. then, on /news/we-just-installed-craft you can see the rendered link back to the "Third news entry..." page.

Sorry, Scott - I hope illustrating two examples isn't confusing! Let us know how you get on.




{% for researchProject in relatedResearchProject %}&lt;li&gt;&lt;a href="{{ researchProject.url }}"&gt;{{ researchProject.title }}&lt;/a&lt;/li&gt;{% endfor %}