Problems, need help? Have a tip or advice? Post it here.
12 posts Page 2 of 2
@KK!
Yeah, only I need to change display order on front-end. In CMS all can be in old way :)
OK. But then I owe you an apology for not being able to understand your problem for so long.
Reversing the order on the front-end has been always possible.

Here is how we do it -
We'll assume you have a repeatable region named 'test' and it has only a single editable region named 'my_text' within it. If following is how you normally display the contents -
Code: Select all
<cms:show_repeatable 'test' >
    <h3>
        <cms:show my_text />
    </h3>
</cms:show_repeatable>

We need to modify the code to make it as follows -
Code: Select all
<cms:show_repeatable 'test' >
    <cms:capture into='my_buffer' global='1' >
        <h3>
            <cms:show my_text />
        </h3>
       
        <cms:show my_buffer />
    </cms:capture>   
</cms:show_repeatable>

<cms:show my_buffer />

In the modified code, instead of directly outputting each row we buffer it in a variable named 'my_buffer' -
<cms:capture into='my_buffer' global='1' >
<h3>
<cms:show my_text />
</h3>

..
</cms:capture>
The important thing is the next statement -
<cms:capture into='my_buffer' global='1' >
<h3>
<cms:show my_text />
</h3>

<cms:show my_buffer />
</cms:capture>
Here we add to the buffer all its *previous contents*. This way we concatenate the old rows to the new one just fetched. This essentially reverses the order of the rows.

And finally we display the contents of the buffer (which contains all rows but in reverse order)
Code: Select all
<cms:show my_buffer />

Buffering the code gives us an opportunity to manipulate the contents.
You can find the same technique being used in the following thread to divide the output into three columns -
viewtopic.php?f=2&t=9196

Hope this helps.
12 posts Page 2 of 2