Nigel
Supporter
Les langues:
Anglais (English )
Espagnol (Español )
Fuseau horaire:
Europe/London (GMT+00:00)
That happens because the conditions for the yellow section ($(wpcf-item-start-date) ne 'TODAY()') and the blue section ($(wpcf-items-statuses) ne 'Complete' ) AND ( $(wpcf-item-end-date) gte 'TODAY()') are both true, and so both get output.
You need to make sure that your conditions are mutually exclusive to avoid outputting more than one block of markup at a time.
But I need multiple blocks to output at the same time.
Nigel
Supporter
Les langues:
Anglais (English )
Espagnol (Español )
Fuseau horaire:
Europe/London (GMT+00:00)
I don't really understand what the problem is, I need more to go on than that.
Sorry Nigel, What I was saying is that I need all the conditions to appear in the same view. Is this not doable?
Nigel
Supporter
Les langues:
Anglais (English )
Espagnol (Español )
Fuseau horaire:
Europe/London (GMT+00:00)
I'm still not sure quite what you mean.
The View iterates over posts, which you are outputting as rows in a table.
For any given row, the tds should be output only once.
You have several conditional tests, each outputting a complete set of tds for that post iteration, i.e. that row.
Which is why you need to carefully choose conditions that are mutually exclusive, so that the set of tds can only ever be output once for that row. Your yellow-and-blue screenshot shows two groups of tds being output for the same row, but there should only ever be one.
So it seems like you need to rethink the logic of your conditional tests (rather than the syntax of implementing the tests).
Otherwise, what do you expect to happen when both the yellow and blue conditions are true for the same post being iterated over?
That they should both be output, but on separate rows?
If that's the case then you would need to move the tr tags inside the linked template, within each conditional section.
Right now they are in the wpv-loop section but not in the linked template, i.e.
<wpv-loop>
<tr>
[wpv-post-body view_template="loop-item-in-locations-on-test"]
</tr>
</wpv-loop>
Sorry for the late reply back Nigel, You meant moving the TR tags into the loop as part of each condition statement? Yes, that appears to have fixed it. Sorry for not making sense.
Nigel
Supporter
Les langues:
Anglais (English )
Espagnol (Español )
Fuseau horaire:
Europe/London (GMT+00:00)
Great, that sounds like a result.
We can close here?
My issue is resolved now. Thank you!