I’m having an issue with the switch variable. My code generates an outer div.team-row and then two inner divs, div.team-member & div.team-member-last
The code works when the number of entries is equal or to put it another way there are two inner divs inside the row. However, if the number is odd then the closing div tag for the row is not generated.
Here is my code
Any help would be appreciated
Thanks
{exp:channel:entries channel="team_members" orderby="title" sort="asc"}
{switch='<div class="team-row">|'}
<div id='{url_title}' class='{switch="team-member|team-member-last"}'>
<h2>{team_name}</h2>
<p> {team_excerpt}<br />
<a href="http://{url_title_path=team}/">Read more</a><br />
<a href="#top" class='top'>back to top</a><br />
</div><br />
{switch='|</div><!--/row-->'} <br />
{/exp:channel:entries}Moved to CodeShare Corner by Moderator