• Resolved ojkosznicki

    (@ojkosznicki)


    Hello there

    I’m running a small motorsport league. I use jersey numbers for car numbers, and “technically” everyone is in the same team for tables/stats purposes.

    However, when I try to put the race results with Finished position beeing main criteria, both Result and Box Score are making very weird sorting.

    I can hide results, and use only Box Score but can I set up which column is default sorting initially?

    Adding drivers one by one does not help, because as soon the new one is added, they are reordered.

    Is there a way to actually fix that?

    It’s weird that even Golf got it’s modification but motorsport doesn’t have one 🙂

    Other than that, plugin looks really promising

    • This topic was modified 2 months, 2 weeks ago by ojkosznicki.

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Contributor Savvas

    (@savvasha)

    Hi there @ojkosznicki ,

    Can you share some more details about your settings and your configuration? Some screenshots will help, especially from SportsPress->Configure->Table Columns

    Also, are you using any shortcode to show the results of the event?

    Ordering is mainly used for Table Columns and not results, so probably thats why you are facing this strange behaviour.

    Thanks,
    Savvas

    Thread Starter ojkosznicki

    (@ojkosznicki)

    That’s how I’ve set it up as for now.
    Didn’t use table columns as well.

    Thread Starter ojkosznicki

    (@ojkosznicki)

    Thread Starter ojkosznicki

    (@ojkosznicki)

    Also, what is the character of data within any tables?
    Both calendar, driver list etc.

    I’ve tried to CSS all the headings, or whole body, but it does not apply for me.

    Plugin Contributor Savvas

    (@savvasha)

    Hi there @ojkosznicki ,

    Try to add the following code to your child’s theme functions.php file or otherwise. I assume that the key of “Finished” performance is finished. If not, please change it accordingly. That way your results will be sorted by Finished value in ascending order.

    add_filter( 'sportspress_event_performance_players', function( $data, $lineups, $subs, $mode ) {
    // Sort by 'finished' performance metric (assuming that's the key)
    if ( isset( $data[0]['finished'] ) || isset( reset( $data )['finished'] ) ) {
    uasort( $data, function( $a, $b ) {
    $a_finished = isset( $a['finished'] ) ? (int) $a['finished'] : 999;
    $b_finished = isset( $b['finished'] ) ? (int) $b['finished'] : 999;
    return $a_finished <=> $b_finished; // Ascending order
    } );
    }
    return $data;
    }, 10, 4 );

    Thanks,
    Savvas

    Thread Starter ojkosznicki

    (@ojkosznicki)

    That did work perfectly, thanks a lot @savvasha !

    Last question, cause I can’t find the proper attribute to change the font of item in the table.

    Tried all H1-H6, tried “body” but still can’t make the table use the Oswald font as well.

    Plugin Contributor Savvas

    (@savvasha)

    It depends what you are trying to change. For example you can try the following to change the color of “Results” to red and the background to bisque:

    .sp_event h4.sp-table-caption {
    color: red !important;
    background: bisque !important;
    }

    To change the color of background and the font at the header of the table you can try something like:

    .sp-data-table th {
    background: yellow !important;
    color: black !important;
    }

    Similar with the rest of the content (just try to use td instead of th)

    Thanks,
    Savvas

Viewing 7 replies - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.