The attached add-on files may be out of date. Please visit Devot-ee for the latest versions.
This plugin enables you to reverse the order of the series of items.
Why such functionality is needed?
For example, you may need to display 10 most recent comments in ascending order. But exp:comment:entries tag allows only to set “sort” parameter value either to “asc” or “desc”. So, after setting “orderby” parameter to “date” and “sort” to “desc” you will get 10 most recent comments but they will be ordered not as you need. To order them as needed their order should be reversed. Here Reverse This plugin comes to your help.
PARAMETERS
No parameters.
VARIABLE PAIR
1) {reverse_these_item}{/reverse_these_item} - any item in the series of items which should be reversed must be wrapped with this variable pair.
USAGE
This code will output latest 10 comments in ascending order.
{exp:reverse_these}
{exp:comment_entries entry_id="531" limit="10" orderby="date" sort="desc"}
{reverse_these_item}
{count}{comment}
{/reverse_these_item}
{/exp:comment_entries}
{/exp:reverse_these}Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.