Hi guys!
Just having a little trouble with the following procedure. Basically I’m creating a series of feature banner fields (image/title/blurb) with a field to allow site admins to ‘show feature’ on the home page or not to on any given entry. For the most part the following works fine, except however the ability to flag the first entry to set the class as ‘active’.
{exp:channel:entries channel="article" limit="6" orderby="date" sort="desc"}
{if feature_article == 'y'}
<div class="{if count == 1}active {/if}item">Content</div>
{/if}
{/exp:channel:entries}The feature_article is my switch field to show the banner in the array. If all banners are set to ‘y’ then the ‘active’ class is added to the first entry through the ‘count’ parameter no problems. But as soon as, say the latest entry has feature_article set to ‘n’, the limit parameter seems to include the hidden entry in the count, thus not enabling the active class to the first entry.
In addition, the true final count is only 5 in the above given circumstance, not 6.
Is there any way to parse the conditional before the limit count? Or am I doing it completely wrong? Any help is much appreciated - thanks!