Loop Plugin
Installation
Download and unzip the Loop plugin, then follow the simple steps below:
ExpressionEngine 2.x:
-
Open the loop_2_0 folder
-
Upload the system/expressionengine/third_party/for_loop folder
ExpressionEngine 1.x:
-
Open the loop_1_6 folder
-
Upload pi.for_loop.php to the system/plugins folder
Updating
Download and unzip the latest version of the Loop plugin, then follow the steps below:
ExpressionEngine 2.x:
-
Overwrite the system/expressionengine/third_party/for_loop folder
ExpressionEngine 1.x:
-
Overwrite system/plugins/pi.for_loop.php
-
{exp:for_loop start="1" end="3" increment="1"}
-
The start parameter is optional and represents the starting value of the index (default is 1).
The end parameter is optional and represents the end value or limit of the index (default is 3).
The increment parameter is optional and represents the incremental value of the index on each iteration of the loop (default is 1).
-
{index}
-
Outputs the value of the index that is incremented in each iteration of the loop
{exp:for_loop start="0" end="33" increment="3"}
{index}
{/exp:for_loop}
// Produces: 0 3 6 9 12 15 18 21 24 27 30 33
-
{loop_count}
-
Outputs the number of times that the loop has been iterated over
{exp:for_loop start="2008" end="2002" increment="-1"}
{loop_count}-{index}
{/exp:for_loop}
// Produces: 1-2008 2-2007 3-2006 4-2005 5-2004 6-2003 7-2002