WordPress.org

Forums

SportsPress - Manage Leagues & Sports Clubs
Adding match number and set scores to the calendar (11 posts)

  1. Sunshyme
    Member
    Posted 11 months ago #

    Hello,

    Is it possible to manually enter a match number when creating a match (event) and display it on the frontend?

    I use it for volleybal: can the scores per set be displayed on the frontend? Now it only can show the results (4-0 3-1 2-2 etc.) but I would be nice if you can see directly the scores per set, without having to go to the event details.

    https://wordpress.org/plugins/sportspress/

  2. ThemeBoy
    Member
    Plugin Author

    Posted 11 months ago #

    @Sunshyme Thanks for your feedback. In the current version, values cannot be attached to events directly. We'll definitely be adding a feature that allows attaching values to events in a future update.

    Regarding displaying multiple results in event lists and event blocks, the best way to do this is via a custom page template. To learn how to do this, please see https://sportspresspro.com/docs/theme-integration-guide/

  3. Sunshyme
    Member
    Posted 11 months ago #

    Thank you for your reply. Is there a way to get this feature soon or a workaround so I can do it manually? I would really like to add a value to seperate matches and make it a sortable option on the frontend. Adding a column with a match number (or other values) to the events shouldn't be a very complex addition as far as I know.

    I don't know where to look in the php files to add this.

    Best regards,
    Michiel

  4. ThemeBoy
    Member
    Plugin Author

    Posted 11 months ago #

    @Sunshyme A good alternative until we add this to core is to use the Advanced Custom Fields plugin: http://wordpress.org/plugins/advanced-custom-fields/

    This plugin will enable you to add custom fields to any post type. Once you've added a Match Number fields to the Event post type, you can then modify the event-list.php template. See this guide on how to create your own SportsPress templates:
    https://sportspresspro.com/docs/theme-integration-guide/#custom-page-templates

  5. Sunshyme
    Member
    Posted 11 months ago #

    Thanks for the quick reply! I will look into this option.

  6. Sunshyme
    Member
    Posted 11 months ago #

    I have added the ACF plugin and I can add a match number in the back end. However, I cannot get it on the frontpage. I tried several option in event-list.php but it does not work.

    Is there a shortcode to call for that custom field in the event-list.php? And something to make it visible in the calendar on the frontpage?

  7. ThemeBoy
    Member
    Plugin Author

    Posted 11 months ago #

    @Sunshyme When using ACF in the event-list.php loop, you'll need to include the event ID. Here's an example of how to get the "match_number" field:

    the_field( "match_number", $event->ID );
  8. Sunshyme
    Member
    Posted 11 months ago #

    That does not seem to work. The calendar crashes most of the time when I try something. I cannot get that extra column in the event list calendar.

    Can I just paste it under the other event-list options (as mentioned below)?

    if ( $usecolumns == null || in_array( 'venue', $usecolumns ) )
    					echo '<th class="data-venue">' . __( 'Venue', 'sportspress' ) . '</th>';
    
    				if ( $usecolumns == null || in_array( 'article', $usecolumns ) )
    					echo '<th class="data-article">' . __( 'Article', 'sportspress' ) . '</th>';
  9. Sunshyme
    Member
    Posted 11 months ago #

    Shouldn't this be an option to turn on/off in the back end on the Calendars page? There you can select date, event, teams, venue etc. It would seem logical to have that custom field (match number) added to that page so it is shown on the page with the corresponding event list.

  10. ThemeBoy
    Member
    Plugin Author

    Posted 11 months ago #

    @Sunshyme We're working on an option for this. Thanks for your patience.

  11. Sunshyme
    Member
    Posted 11 months ago #

    Thank you for your reply. I am really looking forward to this feature. :)

Reply

You must log in to post.

About this Plugin

About this Topic