Please note that the forum isn't realy used anymore.

If you have questions, want support or just simply want to talk to us you can find us on slack.

 

Iteration extra and cycle

Hi

I m having some questions about the iteration extra and cycle functions.

Iteration extra: With iteration extra it is possible to add first/last to the iteration. On www.bubblefish.be/portfolio I ve workd with first and last to show a different structure/markup for these two top elements. (portfolio spotlight) Now i want them to alternate also with more than 2 elements. Can this be done through a counter that is added to the array?

{option:loop.first} becomes {option:loop.1} {option:loop.2}

Or i what way is this achievable?

Cycle: Can we cycle through html code for alternating markup/structure. Not only adding a class/id etc to an element but really including a different markup block?

Normally, can use html inside the cycle tag, for example:

{cycle:'

This has htmlformatting

':'This has no html'}

So you can switch between html code. Not sure if you can parse variables inside these html blocks...

I don't fully understand your first question. Can you give some more information? You can also use the cycle tag with 3 or more parameters:

{cycle:'first row':'second row':'third row'}

Comment

The forum is deprecated in favor of our Slack channel, which provides real-time support for your issues.

Join us on Slack here: https://fork-cms.herokuapp.com/