ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Plugin for League Table?

April 17, 2012 10:36am

Subscribe [3]
  • #1 / Apr 17, 2012 10:36am

    Ant Cooper

    5 posts

    Hi,

    I need to create a simple league table on a site I’m working on. I have a Team channel and a Race channel and could do with a simple way for the client to input the number of points each Team gets in a particular Race. On the front-end I want to show this as a league table with a list of all Teams, how many points they scored in each round, with a sum at the end. This needs to be sorted with the highest score at the top.

    I know how I’d do this if coding from scratch, however, I’d like to keep it within EE if possible. Looked at Matrix and see it has some hooks, not sure how I’d be able to do the total points and sorting using this method though.

    Any thoughts?

    Many thanks, Ant

  • #2 / Apr 17, 2012 10:40pm

    Ryan Irelan

    444 posts

    Hi Ant,

    Is a round part of a race? If so, you can use the Matrix field type: http://pixelandtonic.com/matrix Each row can be a round in a race. You can customize the table to have whatever columns you need.

    On the front-end in your template you use the Matrix tags to display the data.

    Does that make sense or help with what you’re trying to do?

  • #3 / Apr 18, 2012 9:47am

    Ant Cooper

    5 posts

    Hi Ryan,

    Yes, I was planning to use Matrix, but haven’t found a way to create a Total column at the end of the the table. Ideally, there’d be a way to put a SUM(C2:C8) function in there like you can with a spreadsheet.

    I’d thought about creating a custom fieldtype to handle this somehow but haven’t had time to look into it further than a quick check of the docs on P&T site.

    Initially, I might have to go live with just adding things up manually.

    Thanks, Ant

  • #4 / Apr 18, 2012 3:03pm

    Rob Allen

    3114 posts

    If you want to total up some fields there are a couple of handy addons:
    http://devot-ee.com/add-ons/math-plus
    http://devot-ee.com/add-ons/mx-calculator

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases