Hi,
I’m getting odd results once I add a conditional statements to the channel parameter. When I remove the conditionals, the results are sorted correctly.
Sorts oddly:
{exp:channel:entries
channel="prospects"
category="{embed:cat_id}"
disable="category_fields|member_data|pagination|trackbacks"
dynamic="no"
limit="75"
{if "{freebie_2}" == "{current_time format="%Y"}"}orderby="prospects_pro_rating|prospects_college_rating"{/if}
{if "{freebie_2}" != "{current_time format="%Y"}"}orderby="prospects_college_rating|prospects_pro_rating"{/if}
require_entry="yes"
sort="desc|desc"
}
Sorts correctly:
{exp:channel:entries
channel="prospects"
category="{embed:cat_id}"
disable="category_fields|member_data|pagination|trackbacks"
dynamic="no"
limit="75"
orderby="prospects_pro_rating|prospects_college_rating"
require_entry="yes"
sort="desc|desc"
}