Support » Plugin: Hockey GMS Feed » Ordering Fixtures and Results – Brief Question – Thanks!

  • Resolved oscarnewlove

    (@oscarnewlove)


    Hello Matthew – hopefully a quick one.

    Could I please ask about how the tables showing clubwide fixtures and results are sorted by game?

    My guess is results are shown in order of league (i.e. higher leagues are shown at the top, and you’ve equalised mens and womens leagues here based on ‘divisional’ number in our league structures) – is that right?

    It’s hard for me to see what fixtures looks like (as we have none!), but can I please ask how fixtures will be organised?

    For players and spectators, it would be great if we could see the fixtures in order of time (so people can quickly see who’s playing before and after them, who they can support etc).

    Thanks a lot,

    Oscar

    Battersea Wanderers HC

Viewing 15 replies - 1 through 15 (of 22 total)
  • Plugin Author mtreherne

    (@mtreherne)

    Hi Oscar – yes I should be able to sort fixtures by time. As you say I think the default (i.e. what comes from EH) is by league/gender on any given match day. Keep an eye out for next release of plugin and (all being well) I’ll include an option to sort by time.

    Thread Starter oscarnewlove

    (@oscarnewlove)

    Thanks Matthew. That would be brilliant and very much appreciated! Would be a great aid.

    Great work and thanks again!

    Oscar

    Plugin Author mtreherne

    (@mtreherne)

    There is a new shortcode parameter with version 2.7 called “sort_by”. You can use sort_by=”fixtureTime” or sort_by=”reverseDate”. You can use the tool https://gmsfeed.co.uk/shortcode to help. Hopefully that will do the trick for you, once some fixtures are available.

    Thread Starter oscarnewlove

    (@oscarnewlove)

    Amazing – thanks a lot for that and very quick work!

    Looks to do the job brilliantly for the results too.

    Can I please just check what ReverseDate should be doing? Is that a reverse sort on fixtureTime or something else? Seems to provide the same order as fixtureTime when used on Results, but appreciate it may only apply to fixtures!

    Thanks very much again,

    Oscar

    Plugin Author mtreherne

    (@mtreherne)

    Whenever you see a list of fixtures or results the default is to list from oldest date to latest date (for results), and next date to last date (for fixtures) i.e. in ascending order of fixture date. The reverse date will simply show in reverse order i.e. descending date. This might be useful if you are listing all results for a specific team and would prefer to have latest results at the top of the list rather than bottom (which is the default).

    Similarly if you were showing the results for the whole club for the last couple of weeks (e.g. I use whatson=”13″ to see the last two weekends), the reverse date will show the most recent results at the top of the list.

    When you use reverse date it will also list the fixtures by time for a specific day (so you get the sort by “fixtureTime” automatically when you sort by “reverseDate”). Try it out and hopefully it will make sense to sometimes show results with the “reverseDate” option to sort descending by date but ascending by time (for fixtures on the same day).

    Thread Starter oscarnewlove

    (@oscarnewlove)

    Ah I see – brilliant, thanks for the clear explanation. That’s really helpful. So using a mix will be perfect to pull in club and team info in the most appropriate way. Thanks for that, have updated our general ones and will go through and sort the team ones shortly. Cheers!

    Thread Starter oscarnewlove

    (@oscarnewlove)

    Hello Matthew – hope you’re well and summer has been treating you well. The new dynamic addition looks great and really helpful! Please can I ask a quick one on it and the pulling of fixtures more generally?

    I seem to be getting different data back when I run a query using your gmsfeed.co.uk/shortcode tool versus when I copy and paste that shortcode and have the data returned and displayed on our website. I wondered if you might know why that would be / what we could do to fix?

    For example, if I run this: [gms method="api-dynamic" show="fixtures+results" club_id="8ff332b0-004b-401b-aa35-2e78844208d1" sort_by="fixtureTime"] on your gmsfeed.co.uk page, I see the full fixture list for the next league weekend. However, when running on our site, it doesn’t pull any through (and then only pulls fixtures through for some of the teams within the club, when I filter down a bit).

    Similarly, for some teams, despite showing the correct upcoming season for a specific team on your site, when running a team fixtures+results query on our site, I instead see last year’s games….

    I wonder if it’s a caching issue somewhere (may be with us) but thought I’d ask, as occurs even when the shortcode changes a fair bit and the new dynamic feature pulls in.

    Thanks once again for the help!

    Oscar

    Plugin Author mtreherne

    (@mtreherne)

    Hi Oscar,

    I will take a look tomorrow. It may well be a caching issue, but there are some data issues from EH that are causing problems especially with the previous seasons data (due to competition groups not being correctly associated with the right seasons which causes all kind of strange effects).

    Although I have not tested my thinking yet (I will do so tomorrow), I do think that if you have shortcodes on your site that refer to competitions from last season then that could cause a problem. While I do some testing, please could you copy me some more examples of other widgets you have embedded with the “comp_id” specified and a “team”. That will help my investigation.

    Regards, Matt

    Thread Starter oscarnewlove

    (@oscarnewlove)

    Impressively quick response, thanks!

    Ah I see, I did wonder about how the competition groups were managed.

    Yes, of course. Here’s one with our L1 specified (using shortcode snippet provided after I’ve selected drop downs on your page). I would note then that the comp ID isn’t being suggested as a field when using the dynamic option.

    [gms method=”api-dynamic” show=”fixtures+results” team=”fbd29959-c172-45c2-a3f8-8506cfe86226″ club_id=”8ff332b0-004b-401b-aa35-2e78844208d1″ sort_by=”fixtureTime”]

    Then if I select the normal team selection, and allow the comp ID to be included, I again see the results on your site, but see “No fixtures were found that matched the criteria.” on mine. That was using this suggested shortcode:

    [gms method="api" show="fixtures+results" team="fbd29959-c172-45c2-a3f8-8506cfe86226" comp_id="bbd3b34a-7621-4e1d-8bf4-e10a1712241e" sort_by="fixtureTime"]

    My other thought relates to my loading of the data: I have all the teams as separate tabs (hopefully lazy loading but TBC) under the headings of ‘ladies’, ‘mens’ in an accordion block. I’m hoping they aren’t all loading at once upon page load and triggering an issue with exceeding the 10 requests per minute throttle. In theory, someone could click through all 13 teams and struggle on the last 3 teams I guess.

    Thanks again and please let me know if any additional examples on our side would help.

    Oscar

    Plugin Author mtreherne

    (@mtreherne)

    Hi Oscar

    Can I ask under the ‘GMS Feed’ settings do you have the ‘Use AJAX (JavaScript)’ setting default as ‘Yes’ or ‘No’? And do you have a page caching pluging in use for your site? It will help me understand your setup better.

    With respect to the tabs, you should certainly check if they are lazy loaded. As you say that would not be a great setup otherwise. Largely because it will create load on your server and slow response times doing stuff most people won’t look at. You shouldn’t get a problem with the throttling as that is only connected to the gmsfeed.co.uk site (when you are using the tool to create shortcodes). When you retreive data using the widget the data is retrieved from your own WP site and there is no restriction.

    I should explain how the “comp_id” may be causing some of your problems, so that we can rule that out as the cause.

    When you enter a “comp_id” for a competition/league for last season (2022/23) WITH a “team” then you will NEVER see any fixtures or results. You can only see a league table. Including the “team” will simply highlight the team on the league table. I want to show archived results for last seasons leagues but until EH clean the data up that will have to wait.

    If you were trying to show last seasons leagues you might have noticed the above “feature”, BUT you may have inadvertently had a problem due to a fault with EH data. When you use the gmsfeed.co.uk/shortcode site to generate short codes the tool will look up “comp_id” for you but often gets the “comp_id” from LAST season (2022/23) even when you specify (2023/24). This is because the “Competition Groups” found in the EH data warehouse are randomly wrong. At any point in time you may get the list of “Competition Groups” for 2022/23 or 2023/24 or vice versa! Which can lead to you thinking you have a “comp_id” for this season when in fact you have last season! Sorry for the short and probably confusing explanation, but you just need to understand that the tool can give you the wrong “comp_id” which can lead to you showing no fixtures for a team because the “comp_id” used is for last season.

    Basically you need to check you have the right “comp_id”. To do this use the gmsfeed.co.uk/shortcode site as normal but when you have found your club, click on the search icon next to the “Team ID” and switch teams. When you switch teams you will AUTOMATICALLY only get the competitions for the current season 2023/24.

    Can you get back to me on those couple of questions and then check your “comp_id” parameters. Hopefully when we get rid of this noise I can get to the bottom of your problem.

    Regards,
    Matt

    Thread Starter oscarnewlove

    (@oscarnewlove)

    Thanks again Matt and sorry for the delayed checking/response.

    We didn’t have anything ticked for ‘Use AJAX’, but I’ve now ticked ‘Yes’ and updated settings. We had a caching plugin called WP Super Cache, but I’ve just temporarily disabled that to test things.

    I’ve also gone through the shortcode generator again, and made sure to switch teams, to try and find the 2023-24 comp IDs.

    Unfortunately, my responses (when shown on our site) don’t reflect the upcoming season and seem stuck on the previous year – even if I’ve tried to ensure we have the latest comp IDs.

    If using the dynamic api shortcode, then we don’t have the default option to specify the comp ID, but again, it seems to default to the previous season.

    In case it helps, the shortcode does pull through the 2023-24 season fixtures for some of our teams, with an example below:

    [gms method=”api-dynamic” show=”fixtures+results” team=”8607dd80-698b-42ed-887f-4c04258e90bf” club_id=”8ff332b0-004b-401b-aa35-2e78844208d1″ sort_by=”fixtureTime”]

    Then for contrast, this one shows the 2022-23 season only:

    [gms method=”api-dynamic” show=”fixtures+results” team=”4237f8b7-97ec-4da4-8246-5d22e093a914″ club_id=”8ff332b0-004b-401b-aa35-2e78844208d1″ sort_by=”fixtureTime”]

    Thanks once again!

    Oscar

    Plugin Author mtreherne

    (@mtreherne)

    Ok let’s focus on your last shortcode since this should certainly work (i.e. show this seasons fixtures).

    [gms method=”api-dynamic” show=”fixtures+results” team=”4237f8b7-97ec-4da4-8246-5d22e093a914″ club_id=”8ff332b0-004b-401b-aa35-2e78844208d1″ sort_by=”fixtureTime”]

    If you have set the GMS Feed settings to Ajax and either turned off your cache completely or purged/cleared all your cached pages then it should work.

    If it doesn’t then I would like to check what is exactly on the page. Either send me the link to the page with this shortcode, or use the chrome inspector to look at the element with the class=”gms-wrapper gms-ajax” (right click in Chrome anywhere on the widget and select inspect then find the <div> element with that class). By inspecting this element you can confirm that the attributes on the page actually match the shortcode parameters. If they do not then we have something to go on.

    Thread Starter oscarnewlove

    (@oscarnewlove)

    Thanks Matt.

    Unfortunately, I’ve checked that shortcode, but still showing last season’s sadly.

    The link to the page is this url (and then clicking to the “M5” tab, you’ll see the non-working shortcode, showing last season for M5, and below that the working shortcode, showing upcoming season for M6)

    https://www.wanderershockeyclub.co.uk/teams/#tab-29802

    When inspecting the element, I see the below, which match up with our provided shortcode. The element for the working one (the M6 one, looks exactly the same under inspection). Is there a chance that the team-IDs could be confused in the EH database too? I notice that the M5’s previous season is actually the past season of M6, and shows up for M6’s previous season query too. Thanks again

    <div class=”gms-wrapper gms-ajax” data-method=”api-dynamic” data-show=”fixtures+results” data-team=”4237f8b7-97ec-4da4-8246-5d22e093a914″ data-club_id=”8ff332b0-004b-401b-aa35-2e78844208d1″ data-sort_by=”fixtureTime” data-request=”true”><table class=”gms-table gms-table-fixtures”>

    Plugin Author mtreherne

    (@mtreherne)

    Ok that gives us something to work with. If the data provided by EH was temporarily wrong (which is rare) then it would get fixed within hour, so I don’t think that is the problem.

    Can you do let me know what the ‘Transient Expiry’ figure is in the GMS Feed settings and is there any chance this could have been changed (even temporarily)? Either way we probably need to clear the WP transients table to be sure you don’t have old data.

    Thread Starter oscarnewlove

    (@oscarnewlove)

    It was the default 3600s, but I reduced it to 30s earlier this afternoon (when updating AJAX to ‘yes’) in case that was possibly an issue too.

    Thanks!

Viewing 15 replies - 1 through 15 (of 22 total)
  • You must be logged in to reply to this topic.