ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

[SOLVED] counter in exp:channel loop not executing

February 24, 2012 9:49am

Subscribe [1]
  • #1 / Feb 24, 2012 9:49am

    MrBaseball34

    99 posts

    In the EE template below, the if that places an <hr > tag between the entries just stopped working and I don’t know what could have caused it.

    Any ideas what could cause it to stop working? (Yes, there are multiple entries)

    {exp:channel:entries  channel="webinars"  orderby="date"  sort="asc" dynamic="no" start_on="{current_time format='%Y-%m-%d %H:%i'}" show_future_entries="yes"}
        <div class="webinar">
         <h3>{title}</h3>
    <p>     <br />
          <i>{entry_date format="%F %j, %Y"}, {webinar_time}</i><br><br />
          Speaker: {webinar_speaker}<br><br />
          <a href="http://{gtm_link}">Register</a><br />
          {webinar_summary}<br><br />
          Books referenced: {webinar_books}<br />
         <br />
        </div><br />
        {if count != absolute_count}<br />
         <hr><br />
        {/if}<br />
    {/exp:channel:entries}

    I fixed it temporarily by removing the {if} and placing an <hr > tag like this:

    <hr >
     <div class="webinar">

     

  • #2 / Feb 24, 2012 11:56am

    zizther

    228 posts

    Not sure why it would stop working, but if your not happy with your temp fix, maybe you could try putting a php counter in?

  • #3 / Feb 24, 2012 7:11pm

    Sean C. Smith

    3818 posts

    Hi MrBaseball34,

    Did you make any changes to the site, upgrading ExpressionEngine or an add-on that might have caused that code to stop working? That is rather odd. the code I typically use to do the same thing you are doing is:

    {if total_results !="count"}<hr >{/if}

    Does that help?

    Sean

  • #4 / Feb 27, 2012 9:50am

    MrBaseball34

    99 posts

    We’ve decided to leave it with the fix. Thanks for replying.

  • #5 / Feb 27, 2012 6:47pm

    Sean C. Smith

    3818 posts

    MrBaseball34,

    Good to see you have a solution you are happy with. I’m going to close out this thread, but feel free to post again when you have more questions.

    Sean

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases