How to apply images conditionally using entries and categories?

Posted by Sergio Acosta on Stack Overflow See other posts from Stack Overflow or by Sergio Acosta
Published on 2012-11-04T14:41:01Z Indexed on 2012/11/04 17:00 UTC
Read the original article Hit count: 269

Filed under:

Using version 2.5.3 of ExpressionEngine, I have a list of products displayed by category, but I need the premium products among this list being featured with a small star image. How do you call conditionally this little stars besides the {title}?

At the moment this code shows stars for all products and that is not ideal.

<ol class="voices-list">
{exp:channel:entries channel="product" orderby="title" sort="asc" category="2&6" dynamic="no"}  
<li><a href="{page_url}">{title}<img class="feature_icon medium" src="{root_url}img/audio/smallstar.png" alt="star"></a></li>   
{/exp:channel:entries}
</ol>

I need your help, please.

© Stack Overflow or respective owner

Related posts about expressionengine