I have recently upgraded a website to 2.9.0 from 2.5.x so I'm trying to take advantage of the new (to me) relationship capabilities, specifically the siblings tag. We have for a long time, had a relationship field (pro_related_program
) set up in our programs channel where you can choose another program as a related program. This allowed us to create program series, with one overview program page (the mutual child of many parents) and child program pages with a link back to the overview page.
On those child program pages I'd like an "other programs in this series" link. Since it wasn't working for me, I build a bare bones template for testing:
<html><head><title>Test</title></head><body>
<h1>relationship test</h1>
{exp:channel:entries channel="programs" url_title="PFA" status="not nonexistant"}
<h2>{title}</h2>
{siblings field="pro_related_program" status="not nonexistant"}{if siblings:no_results}No results a{/if}<p>{siblings:title}</p>{/siblings}
{pro_related_program}{pro_related_program:siblings field="pro_related_program" status="not nonexistant"}{if pro_related_program:siblings:no_results}No results b{/if}<p>{siblings:title}</p>{/pro_related_program:siblings}{/pro_related_program}
{/exp:channel:entries}
</body></html>
the result is as follows:
<html><head><title>Test</title></head><body>
<h1>relationship test</h1>
<h2>Program title here</h2>
No results a
</body></html>
So what am I doing wrong?
- Is it because both parents and children are both coming from the programs channel?
- Is it, as I suspect it might be, because my relationship is backwards for how EE would like it to be for siblings? (The parent should be the overview?) Or to put it another way, do siblings only work on relationship entries where you can choose multiple children?
- If that is the cause, is there a good way to fake the siblings tag for my situation?
- If not, is there a way to use the channel entries tag to spit out a list of programs with a relationship field filled in? I can test all of these things, but if someone knows it would help.