I am trying to filter posts by category, based on a custom field (program_code) in the user profile.
In order to do this I have tried various ways to form a conditional statement.
for ex:
{exp:member:custom_profile_data}
{if program_code == "ENG2012"}
{exp:channel:entries channel="{my_channel}" disable="pagination" dynamic="yes" category="11" limit="10"}
{if:elseif program_code == "SCO2012"}
{exp:channel:entries channel="{my_channel}" disable="pagination" dynamic="yes" category="128" limit="10"}
{if:elseif program_code == "ITA2012"}
{exp:channel:entries channel="{my_channel}" disable="pagination" dynamic="yes" category="126" limit="10"}
{/if}
{/exp:member:custom_profile_data}
<h3>{title}</h3>
<p> {partner_body}<br />
<ul>{partner_files}<br />
<li>{file_desc}<br />
<a href="http://{file}target=_blank" rel="noopener">{file_name}</a></li><br />
{/partner_files}</ul><br />
{/exp:channel:entries}I have discovered that the first if statement works - ie if the user is ENG2012 then they get the correct page content. However, none of the if:elseif statements work…
I have looked in the manual for example that may be useful but at this point I am stumped. Anyone know if I need to formulate the code differently? Do I need the exp:member:custom_profile_data tags to wrap around every instance of the custom field?
THanks in advance for any assistance..