Posted By

Bopp on 10/14/13


Tagged

TWIG bolt


Versions (?)

How to display pages '5 through 9'..


 / Published in: HTML
 

How to display pages '5 through 9'..

  1. {% setcontent records = "pages/latest/10" limit %}
  2.  
  3. {# use 'for' to iterate over the records. #}
  4. {% for record in records %}
  5.  
  6. {# we only want '5 to 9' #}
  7. {% if loop.index >= 5 and loop.index <= 9 %}
  8.  
  9. <article>
  10.  
  11. <h2><a href="{{ record.link }}">{{ record.title }}</a></h2>
  12. {{ record.introduction }}
  13.  
  14. </article>
  15.  
  16. {% endif %}
  17.  
  18.  
  19. {% enfdor %}

Report this snippet  

You need to login to post a comment.