For loop:
1 |
for(i=1; i<=10; i++) { console.log(i); } |
1 2 3 4 5 |
[loop.@eachIndex start=1 step=1 stop=10 ] [aw2.get @eachIndex dump=true /] [aw2.get @eachIndex.item /] [aw2.get @eachIndex.count /] [/loop.@eachIndex] |
Database query result loop:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
[arr.create set="module.db_params"] [post_type]event[/post_type] [posts_per_page]12[/posts_per_page] [/arr.create] [db.post-builder.get_data args="{module.db_params}" set="template.result" /] Query: [template.get result.request /] Found post count: [template.get result.post_count /] [loop.@eachPost template.result.posts] Post ID: [aw2.get @eachPost.item.ID dump=t /] Post Title: [aw2.get @eachPost.item.post_title dump=t /] Post meta: [aw2.get @eachPost.item.meta dump=t /] Post meta edit_last: [aw2.get @eachPost.item.meta._edit_last dump=t /] [/loop.@eachPost] |