Hi
I am trying to show a different message if the total amount of entries in a template, published between certain dates.
That's the code I am using:
It works if there's a least 1 entry matching the "start_on" and "stop_before" dates.
But the issue is when there's no entry. It will not display anything at all. Even "k_total_records" won't show a thing. I thought it would display "0", but it's not.
My code was made to display something if the "k_total_records" has at least 1 entry between the date range, then it should show something. If there's no entry, show something else.
What am I doing wrong here?
Thanks a lot!
I am trying to show a different message if the total amount of entries in a template, published between certain dates.
That's the code I am using:
- Code: Select all
<cms:pages masterpage='contrats.php' start_on='2018-01-01' stop_before='2018-01-30' show_future_entries='1' limit="1">
<cms:show k_total_records />
<hr>
<cms:if k_total_records ge '1'>
It's one or greater than one!
<cms:else/>
It's less than one!
</cms:if>
</cms:pages>
It works if there's a least 1 entry matching the "start_on" and "stop_before" dates.
But the issue is when there's no entry. It will not display anything at all. Even "k_total_records" won't show a thing. I thought it would display "0", but it's not.
My code was made to display something if the "k_total_records" has at least 1 entry between the date range, then it should show something. If there's no entry, show something else.
What am I doing wrong here?
Thanks a lot!