Hi, I’m relatively new to EE but am loving it. I’m a front-end designer, developer and using EE is simply a joy to use and in my opinion knocks the socks off other platforms. Anyway, these forums have been great for helping me figure out how to do a few fancy things but I’m struggling with one particular idea.
I have a “Recipes” channel with approx 15 channel fields. One of which is a “Featured Recipe” checkbox with ‘Yes’ as the only option. The recipes page displays all entries but my idea is that when a recipe is selected as “featured” by the client it is presented as “Recipe of the month” in the top section of the page.
You can see what I’m trying to do here: http://blackacre.itsproof.co.uk/recipes
Currently I have the following code which works….
{exp:channel:entries channel="recipes" dynamic="no" }
{if featured_recipe }
<div id="recipe-card">
{if recipe_image_thumbnail}{recipe_image_thumbnail}{/if}
<div class="rotm-details">
<h4 class="title-link"><a href="http://{title_permalink=/recipes/recipe}">{title}</a></h4>
{short_description}
</div>
<a href="http://{title_permalink=/recipes/recipe}" class="rotm-link">View this featured recipe</a>
</div>
{/if}The only trouble with the above is that is multiple recipes are selected as “featured” they are all displayed. I’m currently hiding them using css but this is not ideal as the html for each featured recipe in the loop still exists in the HTML. Is there a way that EE can get all featured recipes but only display the latest recipe added, i.e. one with the highest entry ID?
Or is there another, better way to do featured entries?
Thanks.
Neil