Support » Plugin: SportsPress - Sports Club & League Manager » Background colour ranking table & sorting of positions

  • Resolved teh1aeq

    (@teh1aeq)


    Hi ThemeBoy,

    In Joomleague (Joomla plugin) in backend you can specify the background colour of a table row with the following code (example):

    1,1,#hex, Champions/Promotion;
    2,4,#hex, Play-offs;
    9,11,#hex, Play-offs;
    12,12,#hex, Relegation;

    How can I specify this in your plugin? It would be easy to have an option for this in backend/admin, like f.e. Joomleague has.

    As an alternative I used the code you specified in a different topic.

    .page-id-142 .sp-league-table tbody tr:nth-child(1) td {
    border-bottom: 1px dashed #000; /* below 1st */
    }
    .page-id-142 .sp-league-table tbody tr:nth-child(8) td {
    border-top: 1px dashed #000; /* above 12th */
    }

    A dashed line does appear above the 12th position, but not under the first. Any idea why?

    Also, at our Player list (player_gallery) I used the option to sort the players by position. The positions are sorted alphabetical. Is there any way I can give the positions a value of some sort, so they sort the way I pre-set?

    Thanks in advance!

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

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author ThemeBoy

    (@themeboy)

    @teh1aeq Thanks for your feedback. I’ll definitely look into how Joomleague implements background colors in table rows. I have a feeling we might be able to achieve this using CSS.

    Regarding the dashed line code, it looks like the nth-child selector is applying to the 8th row, not the 12th. Also, unless you only want to apply the style to a specific page, it’s ok to remove the .page-id-142 to simplify it. For example:

    .sp-league-table tbody tr:nth-child(1) td {
    border-bottom: 1px dashed #000; /* below 1st */
    }
    .sp-league-table tbody tr:nth-child(12) td {
    border-top: 1px dashed #000; /* above 12th */
    }

    Player positions will be sorted alphabetically by slug, so if you change the slugs of each position (by adding a number before, for instance), they will be reordered.

    Hope this helps!

    Thread Starter teh1aeq

    (@teh1aeq)

    @themeboy Thanks for your response.

    For some reason at my site the player positions aren’t alphabetically sorted by slug, but by the name of the position.

    In Dutch the positions are as following:
    Keeper (goalkeeper, which I gave the slug ‘a’)
    Verdediger (defender, which I gave the slug ‘b’);
    Middenvelder (midfielder, which I gave the slug ‘c’) and
    Aanvaller (striker, which I gave the slug ‘d’).

    The strikers (aanvaller) are listed first. Any idea? 🙂

    Plugin Author ThemeBoy

    (@themeboy)

    @teh1aeq Thanks for your feedback. Looks like positions were being sorted by slug only in player lists. To enable the same sorting in player galleries, please see this commit:

    https://github.com/ThemeBoy/SportsPress/commit/5b169e42a9299a2f7fa2f5d99f2ddd71f9e6b0be

    You can make this change by editing templates/player-gallery.php.
    The next update will contain this fix as well 🙂

    Thread Starter teh1aeq

    (@teh1aeq)

    Thank you!

    I would like to add a few more questions, if possible. 🙂

    When I paste the following code it should only show the upcoming event, right?

    [event_blocks id="146" status="future" date="default" number="1" order="default" show_all_events_link="0"]

    It shows multiple upcoming matches, even though I used value number=”1″. Am I doing something wrong?

    Also at the backend event page I submitted the Player Performance stats (I use goals, yellow- and red cards), and at the frontend player page it shows the correct values. But on the frontend event page itself it shows none. I would like to create something like you did here (incl. the small icons). Could you please help me with that?

    At last I have one final request. Is it possible for you to make a team, when they don’t have any players added to a certain event, automatically ‘dissapear’? This would look much better and comes in handy when you manage a club’s website (where you don’t register the opponent’s stats).

    Thanks in advance! 🙂

    Plugin Author ThemeBoy

    (@themeboy)

    @teh1aeq

    Thanks for letting us know about the “number” issue in the event blocks shortcode. We’ve just released a fix for this.

    We’ve also added an option that allows you to completely hide team performance in events. Once you’ve installed the update, please go to SportsPress > Settings > Events and uncheck the “Display total” option next to “Player Performance”.

    Both are available in version 1.2.1:

    http://wordpress.org/plugins/sportspress/changelog/

    Regarding player performance stats, you’ll need to check the checkboxes at the top next to each label that you’d like to display. Please let me know if they are already checked but still not being displayed.

    Hope this helps!

    Thread Starter teh1aeq

    (@teh1aeq)

    ThemeBoy,

    You solved all my ‘problems’, for which I’m very thankful.

    The ‘matchpage’ looks good with the numeric stats, but even better with small icons like you have here. Is there an (easy) way to accomplish this?

    Thanks again for your amazing support.

    Plugin Author ThemeBoy

    (@themeboy)

    @teh1aeq Glad I could help!

    The icons seen in Football Club are generate via a custom template. It is possible (but not easy) to create your own template if you’re up to the challenge: https://sportspresspro.com/docs/theme-integration-guide/

    Thread Starter teh1aeq

    (@teh1aeq)

    I will look into it, thank you!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Background colour ranking table & sorting of positions’ is closed to new replies.