3

i have made this code to generate the new entries wich have been posted.

<div class="nieuwe_berichten">
  {exp:channel:entries channel="interne_memo" display_by="week" limit="1" show_current_week="yes"}
    {total_results} nieuwe berichten!
  {/exp:channel:entries}
</div>

This code generates only: “2 nieuwe berichten” and also 2 times. Does anybody know how to write a good code for this?

thnx in advance, Leon vd Leer

1
{exp:channel:entries 
    channel="interne_memo"
    display_by="week"
    limit="1"
    show_current_week="yes"}
    {if no_results}0 nieuwe berichten{/if}

    {!-- your display for each entry here --}

    {if {count} == {total_results}}
        {total_results} nieuwe berichten! 
    {/if}
{/exp:channel:entries}

Update: Revisiting this question, I can't work out why limit is in the parameters, as this will always force only 1 entry to return. This would surely be better:

{exp:channel:entries 
    channel="interne_memo"
    display_by="week"
    dynamic="no"
    show_current_week="yes"}
11
  • thnx! it's working!! Jul 30 '13 at 14:26
  • Can you mark it as correct answer to complete it please. Jul 31 '13 at 14:04
  • Hi @LeonvdLeer - if you found this helpful, please don't forget to come back and mark it as "accepted" (using the check box on the left). This tells others that it is the correct solution. Aug 7 '13 at 15:30
  • Ok this was working, but now: when i aply a new memo it says "2 nieuwe berichten" but it is always showing: "1 nieuwe berichten" is it possible to get the return, 0? Sep 6 '13 at 9:14
  • Sorry, your question doesn't make sense: it says "2 nieuwe berichten" but shows "1 nieuwe berichten" - which is it?!? Assuming you mean there are 2 and it's displaying 1, I think the problem is limit="1" which I copied from your original - remove it. Sep 6 '13 at 12:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.