Hi there,
I have two related custom post types:
1. Programmes (Parent Post)
2. Sessions (Child Post) >> Session Modules (Taxonomy)
Relationship: programme_session — Migrated >> Programmes [0 .. 1] << Sessions [*]
The relationship was migrated from the old Toolset, and on the ‘Edit relationship’ screen it says:
Programmes: 1 Programme can be assigned to one Session
Sessions: Infinite Sessions can be assigned to one Programme
- Each Programme is one year, for example ‘Way of the Heart 2016’
- Session Modules are the months in that year, for example ‘January 2016’, ‘February 2016’ etc
- Each Session Module has a few Sessions (Webcasts) assigned.
======================
Here’s my problem, and with the Programmes single template:
I want to display all the Session Modules, with the nested Sessions belonging to each Session Module.
As you can see, it’s working >> hidden link
But, the empty Session Modules, that does not have any Sessions assigned to this Programme, are also showing, for ex:
January 2017- No items found
February 2017 - No items found
Etc
(I’m not sure if I set this up right, perhaps Session Modules should be a CPT, and NOT a taxonomy?)
In any case, the below is what I have to display the current Programmes single template:
======================
Single Template: Programmes Single >>
[wpv-view name="programme-modules" orderby="id" order="asc"]
======================
View: Programme Modules
Terms of the taxonomy Session Modules ordered by , ascending
<wpv-loop>
<h2>[wpv-taxonomy-link]</h2>
[wpv-view name="module-sessions-by-module-per-programme"]
</wpv-loop>
======================
View: Module Sessions by Module per Programme
Sessions ordered by post date, ascending
Has two filters:
1. Filter by post relationship or repeatable fields group owner
Select posts in a programme_session relationship that are related to the Post where this View is shown.
2. Taxonomy filter
Select posts with taxonomy:
Session Modules set by the parent Taxonomy View
And the template
<wpv-loop>
[wpv-post-body view_template="loop-item-in-module-sessions-by-module-per-programme"]
</wpv-loop>
Templates for this view:
Loop item in Module Sessions by Module per Programme
[wpv-post-link]<br/>
======================
Can you please advise me in displaying the single Programmes template without the empty Session Modules?
And can you please advise me on whether the Session Modules would play better as CPT’s instead of a taxonomy?
Thank you so much!
Rich