1

I have a members area where the user can either be Male/Female, Building Muscle/Losing Weight, and either Beginner/Intermediate/Advanced

The way it worked before is if the user was a Female, trying to Lose Weight, and was a Beginner it would display content for that user.

EDIT: Sorry I thought I mentioned the issue! The problem is it will either display content randomly or nothing at all and I'm using User 3.4.5 and EE 2.7 This is how the Supplement Section was coded:

{exp:user:stats}
    <ul id="membersboxes" class="block-grid three-up clearfix">
        <li>
            <div class="membersbox">       
                {if member_gender == "Female" && member_goal == "Build Muscle" && member_level == "Beginner"}
                {exp:channel:entries channel="supplement_guides"  category="42|43|45" dynamic="no" limit="1" status="open"}
                <h4><a href="{page_url}">{title}</a></h4>
                <p>{exp:trunchtml chars="150" inline="..."}{guide_content}{/exp:trunchtml}</p>
                {/exp:channel:entries}
                {/if}

                {if member_gender == "Female" && member_goal == "Build Muscle" && member_level == "Intermediate"}
                {exp:channel:entries channel="supplement_guides"  category="42|43|46" dynamic="no" limit="1" status="open"}
                <h4><a href="{page_url}">{title}</a></h4>
                <p>{exp:trunchtml chars="150" inline="..."}{guide_content}{/exp:trunchtml}</p>
                {/exp:channel:entries}
                {/if}

                {if member_gender == "Female" && member_goal == "Build Muscle" && member_level == "Advanced"}
                {exp:channel:entries channel="supplement_guides"  category="42|43|47" dynamic="no" limit="1" status="open"}
                <h4><a href="{page_url}">{title}</a></h4>
                <p>{exp:trunchtml chars="150" inline="..."}{guide_content}{/exp:trunchtml}</p>
                {/exp:channel:entries}
                {/if}

                {if member_gender == "Female" && member_goal == "Lose Weight" && member_level == "Beginner"}
                {exp:channel:entries channel="supplement_guides"  category="42|44|45" dynamic="no" limit="1" status="open"}
                <h4><a href="{page_url}">{title}</a></h4>
                <p>{exp:trunchtml chars="150" inline="..."}{guide_content}{/exp:trunchtml}</p>
                {/exp:channel:entries}
                {/if}

                {if member_gender == "Female" && member_goal == "Lose Weight" && member_level == "Intermediate"}
                {exp:channel:entries channel="supplement_guides"  category="42|44|46" dynamic="no" limit="1" status="open"}
                <h4><a href="{page_url}">{title}</a></h4>
                <p>{exp:trunchtml chars="150" inline="..."}{guide_content}{/exp:trunchtml}</p>
                {/exp:channel:entries}
                {/if}

                {if member_gender == "Female" && member_goal == "Lose Weight" && member_level == "Advanced"}
                {exp:channel:entries channel="supplement_guides"  category="42|44|47" dynamic="no" limit="1" status="open"}
                <h4><a href="{page_url}">{title}</a></h4>
                <p>{exp:trunchtml chars="150" inline="..."}{guide_content}{/exp:trunchtml}</p>
                {/exp:channel:entries}
                {/if}

                <span class="seeall"><a href="{path='members-area/supplement-guides/'}">See All Supplement Guides</a></span>
            </div>
        </li>
    </ul>
{/exp:user:stats}

This is just the supplements part of the female section, but for the entire code for Males/Females and including everything else you can visit THIS LINK

Here is an image of the member fields: member fieldscategories

Here is an image of the categories:categories

And here is how a user changes the type of member they are:membertype

And the code for that part of the settings page:

{exp:user:edit return="{path='member/updated-settings/'}"}
    <div class="settingswrap">
        <div class="membersheader">
            <h2>Current Level</h2>
        </div>
        <div class="member-settings">
            <label>Gender</label>
            <select name="member_gender">
                {select_member_gender}
                <option value="{value}" {selected}>{value}</option>
                {/select_member_gender}
            </select>
        </div>
        <div class="member-settings">
            <label>Goal</label>
            <select name="member_goal">
                {select_member_goal}
                <option value="{value}" {selected}>{value}</option>
                {/select_member_goal}
            </select>
        </div>
        <div class="member-settings">
            <label>Level</label>
            <select name="member_level">
                {select_member_level}
                <option value="{value}" {selected}>{value}</option>
                {/select_member_level}
            </select>
        </div>
        <div class="save-settings">
            <input type="submit"  class="small blk button radius" name="submit" value="Save Settings" />
        </div>
    </div>
{/exp:user:edit}

It was working perfectly before.. not sure if the 2.7 update could of changed anything but I don't know what to do.

Please help if you can.. this site is suppose to go up soon and I don't know what to do

3
  • I might have missed it, but it would help to include your version of User and also what's wrong/changed with the output. – Romans-8---31-39 Sep 26 '13 at 18:09
  • When you say User:Stats no longer displays the correct info, do you have any further info that can help clarify that? Is it a particular part in the "process" that seems to be the issue? If you create a new testing template and simplify your conditionals to just ONE conditional at a time, do they evaluate correctly? :) – Solspace Sep 26 '13 at 21:54
  • @Solspace I tried just 1 conditional for each box but still no luck.. I also tried switching them to {if}, {if:elseif}, {if:else} conditionals – Joe Bobby Sep 27 '13 at 13:10
1

I went in and also noticed that your entry was displayed, using on your {exp:channel:entries} code in the above first block of code, despite category 45, "Beginner", not being selected in the entry. However, I notice you are using

category="41|43|45"

...in {exp:channel:entries}. I assume in this case you want to have entries with categories 41 AND 43 AND 45, is that correct? If so, you need this syntax:

category="41&43&45"

Here's the reference in the EE documentation: http://ellislab.com/expressionengine/user-guide/modules/channel/channel_entries.html#category

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.