-
Notifications
You must be signed in to change notification settings - Fork 126
Description
Description of the problem
When using the channel parameter the {siblings} tag doesn't output anything if the specified channel is a parent channel. I would expect to be able to use a parent channel to filter entries, which is crucial, for example, if the same field is used in multiple parents channels.
In my example, I imagined a school where students belong to both classes and football teams. The members of each class don't necessarily coincide with the members of each team, although both classes and teams have members from the same students pool.
Therefore I created 3 channels (classes, teams and students) and used just one relationship field (members) to link classes and teams to the same students channel.
How To Reproduce
-
Start from a fresh installation and name the website (v.5.2.2).
-
Create the following channels structure:
Classes
title Text Input
url_title Text Input
members Relationship (pointing to Students channel, multiple Students)
Teams
title Text Input
url_title Text Input
members Relationship (pointing to Students channel, multiple Students)
Students
title Text Input
url_title Text Input
name Text Input
-
Create several students (Robert, Nick, Jack, John, Mark, Tom), 1 class (with members Jack, John, Mark, Robert) and 1 team (with members Nick, Robert, Tom).
-
Create a template group called siblings and in the index page use the following code (you can use the teams or classes channel to filter, the result is the same):
{exp:channel:entries channel="students" url_title="robert"}
{siblings channel="teams" field="members" backspace="6"}
{siblings:name}
{/siblings}
{/exp:channel:entries}
-
Load the siblings template. The code will output nothing.
-
If you filter only by the members field everything works (the output is Jack Nick John Tom Mark ), but you get Robert's siblings from both his class and team, which is not what I am trying to achieve.
Error Messages
No error messages: simply the siblings tag prints nothing.
Screenshots / Videos / Template Code
N/A
Environment Details:
- Version: 5.2.2
- PHP Version 7.2.12
- MySQL Version 5.6.39-83.1
- OS: Linux
- Web Server: Apache 2.2.34
Possible Solution
N/A
Additional context
N/A