I'm having trouble sorting some of the records related to reverse connection. There are only some restrictions with EE, and I am looking for a quick solution. Any help you can provide will be appreciated.
I have two channels: registration and students. Students have a relationship field that links each entry to an entry on the enrollment channel. (I need to continue to use the EE relationship field.)
The student channel has two groups of categories assigned to it: classes (group No. 1) and instrument (group No. 2). Category identifiers No. 1-6 are categorized.
The following code reaches half what I need:
{exp:channel:entries channel="registrations" entry_id="{segment_4}" dynamic="no"} <table> {reverse_related_entries channel="students"} {categories show="1|2"} <tr> <td><?php print $count; ?>.</td> <td>{title}</td> {embed="_includes/student_print" student_id="{entry_id}"} </tr> {/categories} {/reverse_related_entries} </table> <table> {reverse_related_entries channel="students"} {categories show="3|4"} <tr> <td><?php print $count; ?>.</td> <td>{title}</td> {embed="_includes/student_print" student_id="{entry_id}"} </tr> {/categories} {/reverse_related_entries} </table> <table> {reverse_related_entries channel="students"} {categories show="5|6"} <tr> <td><?php print $count; ?>.</td> <td>{title}</td> {embed="_includes/student_print" student_id="{entry_id}"} </tr> {/categories} {/reverse_related_entries} </table> {/exp:channel:entries}
Here embed_print embed:
{exp:channel:entries channel="students" entry_id="{embed:student_id}" dynamic="no"} <td><font size="2">{categories show_group="2"}{category_name}{/categories}</font></td> <td><font size="2">{categories show_group="1"}{category_name}{/categories}</font></td> {/exp:channel:entries}
Now, what I need is to organize the reverse records of the CUSTOM ORDER categories in the tool category group (group No. 2). I simply did not know how to do what I am doing now (displaying three tables - each of which displays entries from certain categories in group No. 1) and places them in the user-defined order of categories in group No. 2.
Again - the categories in group # 2 are individually arranged, and I need to display the corresponding entries in this custom order. It is important.
Any ideas? Can this be done with a custom query? I would really appreciate a code example - if possible. This stretches my EE and SQL chops as is.
Thank you for your time.
Mathew smith
source share