We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

How do I get alternating values for channel entries?

How Do I?

andrew.reff's avatar
andrew.reff
26 posts
5 years ago
andrew.reff's avatar andrew.reff

I am trying to figure out how would I go about getting the result of my channel entries to render with alternating values on the html structure I have below;

<ol class=”portfolio-list”> {exp:channel:entries channel="portfolio" cache="yes"}<li data-aos=”fade-CHANGINGVALUE”> _ <div class=”portfolio-thumb”>_ {project-banner}_ </div>_ <div class=”portfolio-summary”>_ <div class=”portfolio-summary-title”>{title}</div>_ </div>_ </li> {/exp:channel:entries}
</ol>

Above, where I have CHANGINGVALUE, I need it to alternate from left/right as it goes down a list. I feel like I’m close and feel like there is something super easy I am missing … Asking for the help from the community! Any help is greatly appreciated.

       
andrew.reff's avatar
andrew.reff
26 posts
5 years ago
andrew.reff's avatar andrew.reff

Found the answer! It was a “switch” was what I was looking for - https://docs.expressionengine.com/latest/channels/entries.html

? 1
       
Robin Sowell's avatar
Robin Sowell
13,158 posts
5 years ago
Robin Sowell's avatar Robin Sowell

That was fast! Thanks for sharing the solution.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.