ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Matching Channel Data

July 11, 2014 5:20am

Subscribe [2]
  • #1 / Jul 11, 2014 5:20am

    eigotec

    19 posts

    I have a channel that displays all students called students, which is laid out as like a profile and a channel called grades which unsurprisingly displays grades.

    At the bottom of the students profile, I want to display their grades. I am having an issue of matching grades to students as i can’t seem to get them per username.

    I want the grades to be displayed per student even if a user is logged in or not logged in.

    I have already seen about embedding a channel inside another channel, and that works fine. The issue is all users grades are being displayed for every user.

    I have tried the relationship field, but i cannot seem to get author_id to match up with anything from the students channel.

    I am using the free version of EE.

    Thanks.

  • #2 / Jul 11, 2014 9:54am

    Boyink!

    5011 posts

    I have tried the relationship field, but i cannot seem to get author_id to match up with anything from the students channel.

    This was the right track. I’d recommend going back to it. You shouldn’t need to worry about matching anything up. You would create a relationship field in the Students channel, and select their grades in it. Then when using a channel:entries loop in to pull student info you would use the relationship field code to pull grades.

    Alternatively you could also probably look at using a Grid field in the Students channel to hold grades instead - unless there is a good reason for needing them in their own channel.

  • #3 / Jul 12, 2014 4:29am

    eigotec

    19 posts

    Great, thanks for the reply

    I’m looking to do something like this

    {exp:channel:entries channel="students" search:exam="GCSE"}
     {results_footer}
      {if count > 3 && count < 10}
       {site_url}images/badges/60/gcse-bronze.png
      {if:elseif count > 10 && count < 20}
       {site_url}images/badges/60/gcse-silver.png
      {if:elseif count < 3}
       {site_url}images/badges/60/locked.png
      {/if}
     {/results_footer}
    {/exp:channel:entries}

    Do you know how i would get the count?

    Thanks.

  • #4 / Jul 12, 2014 8:38am

    Boyink!

    5011 posts

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases