We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

count, total_results won't match correctly

Development and Programming

cranacsystems's avatar
cranacsystems
27 posts
8 years ago
cranacsystems's avatar cranacsystems

Hi,

I have a system running 2.10.1. The code is looping through entries, then for each entry it is looping through related entries from another channel.

The sub-loop is in a snippet called inside the exp:channel:entries loop. The code works on the development server and it used to work on the production server as well.

On the production server it stopped working at some point and I can’t make it work.

This line can’t catch the last result anymore:

{if routes:count == routes:total_results}

Did anyone have an experience like this before?

Thanks, Luke

{routes}
 {if routes:count == 1}
 <div class="e-lee-routes">
  <a href="http://%22class=%22e-leer-header{if" class="e-leer-header{if segment_2 == url_title} t-open{/if}">Routes</a>
  <div class="e-leer-wrapper"{if segment_2 == url_title} >
   <div class="m-list t-no-columns t-route">
    <ul class="c-l-list">
 {/if}
     <li class="c-ll-item">
      <a href="http://{path=class=c-lli-link">{routes:route_nr} - {routes:route_name}</a>
 {embed="locations/_bulletins" entry_id="{routes:entry_id}"}
     </li>
 {if routes:count == routes:total_results}
    </ul>
   </div>
  </div>
 </div>
 {/if}
{/routes}
       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.