Hello,
I am currently working on a website for a sports team and want to display recent results and upcoming fixtures for this team.
I can get it to pull back the correct data i think but the problem is that the matches and results are stored using Grid across multiple entries and even though i am using a limit=”3”, it is returning 3 results from each entry. Is there any way to combine all of the data from across all of the different entries and only return 3 results?
The EE code i have used for the 3 recent results is:
{exp:channel:entries channel="league"}
{league-game limit="3" orderby="match-date" sort="desc" search:match-date="<={current_time}"}
<li>
<a href="http://">_ <abbr title="{league-game:match-score}">{league-game:match-score}</abbr>_ <strong>{league-game:match-home-team} {league-game:match-home-score} - {league-game:match-away-score} {league-game:match-away-team}</strong>_ {league-game:match-date format="%d %M, %Y"}_ </a>
</li>
{/league-game}
{/exp:channel:entries}
Has anyone come across a similar problem?
I can change the way this data is entered and not use Grid for matches, but this is quite a nice way for editors long term.
Chris
Thanks PM dmDev08 for taking a look. One of the main reasons for doing this was to try and make data entry & updating easy for editors.
There are 7 teams and various different tournaments throughout the year - the second team play in two leagues per year so i can imagine it getting a little bit messy after a couple of years.
It would be great if it could be done via Grid, but if not i will revert to using a separate channel for matches and associate them to a league another way such as categories.
Chris
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.