I want to display the first 10 entries that have a “rating” > 3, where rating is a custom field. Here is the code I used:
{exp:weblog:entries weblog="equipment"}
{if rating > 3}{title}{/if}
{/exp:weblog:entries}
The problem I run into is that this code cycles through the first 10 entries and pulls out only those with a rating < 3. The end result is I end up with less than 10 entries on the page.
Is the only way to do what I want it do is to use some sort of php code that does an x+1 type thing? Or is there a better way I am missing?
If php is the only way then can someone help me with the code? I get the concept but I dont know how to execute it.
Many thanks!
I highly doubt it. I’m going to move this to the Modules forum; I’d also recommend posting over on Solspace.com’s forums for ideas on how best to handle this.
[Edit]: I haven’t used the ratings module, but if it stores the rating in a custom field then this extension will still work probably (as you’re still using the {exp:weblog:entries} tag - however there may be a cleaner and easier way to pull up only entries with a particular rating, using the module. So I’d recommend posting on the solspace forums to find out. =)
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.