Hello,
I’m currently building a site where we have business listings. We have 3 member groups i.e. Bronze, Silver, Gold.
Depending on the membership group, a member will have more or less options in their SAEF, i.e. additional images etc.
On my front end listing page of a category, i.e. Bars, I wanted to able to prioritise the listing based on member groups - i.e. Show Gold listings at the top, Silver listings under, then Bronze at the bottom.
I thought it would be a simple case of running 3 loops in that order something like:
{exp:channel:entries channel="listing" dynamic="on" category="{segment_3_category_id}" orderby="random"}
{if member_group =="1"}
//Gold Members image, title, excerpt
{/if}
{/exp:channel:entries}
{exp:channel:entries channel="listing" dynamic="on" category="{segment_3_category_id}" orderby="random"}
{if member_group =="2"}
//Silver Members image, title
{/if}
{/exp:channel:entries}
{exp:channel:entries channel="listing" dynamic="on" category="{segment_3_category_id}"}
{if member_group =="3" OR member_group !="1|2"}
//Bronze Members title, tel/fax/email
{/if}
{/exp:channel:entries}This doesn’t work - am I right in assuming that the member_group will only hook into logged in members and not allow anything inside an entries loop?
Is there a work around or better way to do this, I’m aware that 3 loops on the page is not the most efficient approach at the moment - I was thinking of hidden fields in the SAEF i.e. a field called “Priority” where by a value of “GOLD, SILVER, BRONZE” could be conditionally put into a hidden field based on member gorup i.e.
{if logged_in_group_id =="1"}
<input name="priority" value="GOLD" />
{if:elseif logged_in_group_id =="2"}
<input name="priority" value="SILVER" />
{if:elseif logged_in_group_id =="3"}
<input name="priority" value="BRONZE" />
{/if}Obviously this hidden field could be “firebugged” to change the value so it’s not ideal, and I think I would either need to use cusotm query to get the list and organise by priority in one Loop.
Any suggestions would be greatly appreciated, I’m a little stuck on the best approach here.