In order to list entries on your database you need to use {LOOP} tag. LOOP tag consist of three parts. 1) LOOP:form_name 2) LOOP:else (optional) 3) LOOP:end (must)
Let me explain this to you with an example. Let's say you wanted to list blog post on your site.
{LOOP:blog_posts}
{title} --------- {body}
{LOOP:else}
No posts yet!.
{LOOP:end}
On loop tag you need to specify the exact form name which you want to list the results of. If {LOOP:else} tag is specified, the code between loop tag and loop:else tag will be replaced with real data and repeatedly printed on the page. If loop:else tag is specified and there is no data to display the data between loop:else tag and loop:end tag will be printed on the screen. --
Let's say you want to list you entries in a column order you can specify column number on LOOP tag as a third parameter and it will print results as a table.
{LOOP:blog_posts:4} will print results in 4 columns, 5th result will start in a new row.
Tags:
template tags listing
Related Articles:
Add a new comment
|
Send Comment