jsontemplate - Can I insert content after every third item in a Squarespace JSONT repeated loop? -


how can add new row after 3 items in repeat loop? repeat loop is:

<div class="row">     {.repeated section items}     <div class="col-lg-4 col-md-4 col-sm-6 col-xs-12 gallery-item">         {.image?}<img class="img-responsive loading" {@|image-meta} />{.end}     </div>      {.equal? @index 3}     </div><div class="row separator">     {.end}     {.end} </div> 

i can add row after first 3 items, want add after each third element

{.equal? @index 3} </div><div class="row separator"> {.end} 

edit: don't find information in docs.

as far know there's not built in way "every third item". you're on right track. can preset intervals depending upon intended page size. keep template bit simplified can use block partial:

blog-separator.block

</div><div class="row separator"> 

blog.list

{.equal? @index 3}    {@|apply blog-separator.block} {.end} {.equal? @index 6}    {@|apply blog-separator.block} {.end} {.equal? @index 9}    {@|apply blog-separator.block} {.end} 

Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -