ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Offset Channel Entries Loop

April 04, 2012 4:40am

Subscribe [1]
  • #1 / Apr 04, 2012 4:40am

    Andrew Fairlie

    126 posts

    Hi all,

    I’m wondering if anybody knows of a nice way to offset entries in a channel entry loop.

    I have a bunch of client logos that with the help of JS rotate, there’s actually a 3x4 grid of icons, all displaying the same logos in the same order but starting from different points.

    So if the actual sequence is:-

    A - B - C - D - E - F - G

    The second box on the grid would display it as

    B - C - D - E - F - G - A

    ... and the third…

    C - D - E - F - G - A - B

    ...etc.

    Does anybody know of the best route to do this?

  • #2 / Apr 05, 2012 9:15am

    Lisa Wess

    20502 posts

    Hi, Andrew -

    Would the offset= parameter help with this?

  • #3 / Apr 05, 2012 9:17am

    Andrew Fairlie

    126 posts

    Hi Lisa,

    I did wonder - however it appears that offset skips anything that comes before the offset. In this instance I’d need it to loop back to those that have been offsetted at the end.

    Cheers.

  • #4 / Apr 05, 2012 9:19am

    Andrew Fairlie

    126 posts

    Although, thinking about it… I could offset by 1 and then do another channel loop limited by the amount I’ve offset by.

    For example

    {exp:channel:entries channel="ch_test" offset="3"}{title}{/exp:channel:entries}
    {exp:channel:entries channel="ch_test" limit="3"}{title}{/exp:channel:entries}

  • #5 / Apr 05, 2012 9:25am

    Lisa Wess

    20502 posts

    Hi, Andrew -

    Yes, I was assuming there would be 3 channel entries tags, one with no offset, one with 1 offset, one with 2 offset.

    Make more sense now?

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases