Geco User Help

/ » How-tos » Custom Results   (en | fr)

Results Customization

Template files for results, splits, runner ticket, etc. can be modified with any text editor for customization. By default, templates produce html files, but any text format (csv, json, xml…) can be generated by Geco and the mustache rendering engine.

Four types of result templates are used by Geco:

  • ranking
  • ranking with split times
  • runner splits, multi-columns
  • runner splits, ticket for thermal printer

You can change texts, inserts logos, add or delete some data fields. Geco automatically fills in data fields, marked by double braces {{ and }}.

Reusing Templates and Stage Customization

You can modify, create, reuse those templates in many stages, share them with other people… You will probably find yourself reusing a few templates over and over in multiple stages. It is possible to further customize such templates (with sponsor logos, specific news) without making a copy for each stage. You can create your own data fields in a file named formats.prop for each stage directory. Geco reads this file each time and injects custom data into your template.

Sample:

results.mustache (common file, reusable)

See you on {{NextStage}}

formats.prop (in stage directory)

NextStage=May 23 at the Castle

The results.mustache file can then be reused in many stages without change. Just copying and adapting the formats.prop file would be enough.

Please note that Geco uses geco_ ou i18n_ prefixes for its own data fields. Don’t use such prefixes, they are here to avoid name collisions with your own fields.

Available Data Fields (Description)

Templates contain mustache data fields as marked by double braces {{ and }}. Geco detects and replaces those fields when generating results file using the required data: stage name, runner name, time, control code, status…

Mustache provides three kinds of field:

  • {{geco_RunnerName}} is a basic data field: it will be replaced by the runner name in the generated file.
  • {{#geco_RunnersCollection}}...{{/geco_RunnersCollection}} represents an iterative section which stands for a collection of runners: section content will be generated once for each runner.
  • {{#geco_BestTime?}}...{{/geco_BestTime?}} represents an optional section: content will appear only if the value geco_BestTime? is true - thus some data can appear or not depending on configuration variables (by convention, such fields are suffixed by ?).

Some sections only exist nested inside other sections. For example, at top level you can find results by course, then for each course you will find runners, then for each runner you will find split times.

Ranking Template

General information (top level):

  • geco_StageTitle : stage name
  • geco_Timestamp : last publish timestamp for results
  • #geco_SingleCourse? : true if results are computed by course or not
  • #geco_RunnerCategory? : true if runner category display provides some relevant information
  • #geco_Penalties? : true if user ticks the penalties checkbox
  • #geco_AutoRefresh?
  • #geco_FileOutput?
  • #geco_PrintMode?

The top level context also contains the #geco_ResultsCollection field, which lists all results ordered by group (courses or categories). Group data fields are described below.

For each course/category in the results:

  • geco_ResultName : group name (course, category, …)
  • geco_NbFinishedRunners
  • geco_NbPresentRunners
  • geco_CourseLength : this field is relevant only if #geco_SingleCourse? is true
  • geco_CourseClimb : this field is relevant only if #geco_SingleCourse? is true
  • #geco_RankedRunners : list of ranked runners
  • #geco_UnrankedRunners : list of unranked runners

For each runner (ranked or not):

  • geco_RunnerRank : place in ranking (empty if unranked)
  • geco_RunnerStartId
  • geco_RunnerFirstName
  • geco_RunnerLastName
  • geco_RunnerClubName
  • geco_RunnerCategory
  • geco_RunnerResultTime : official time for the runner
  • geco_RunnerStatus : status
  • geco_RunnerStatusOrTime : shortcut showing runner time if OK, status otherwise
  • geco_RunnerDiffTime : time to first runner
  • geco_RunnerPace : average pace
  • geco_RunnerNbMPs : MPs count
  • geco_RunnerRaceTime : real race time (without penalties)

Ranking Template with Split Times

Same fields as above. More data fields are included per each runner:

  • #geco_SplitRows : list of split rows to display (depending on the number of columns and the number of splits)
    • #geco_ControlRow : list of controls on one line
      • geco_ControlNum : control order (in sequence)
      • geco_ControlCode : control code
    • #geco_TimeRow : list of cumulative times on one line
      • #geco_BestTime? : true if this is a best time
      • geco_ControlTime : cumulative time at control
    • #geco_SplitRow : list of splits on one line
      • #geco_BestSplit? : true if this is a best split
      • geco_SplitTime : split time for control

Runner Splits, Multi-columns Template

The data fields for the runner are available (except rank and diff time), as well as split times in rows and columns (as above) and some data about the stage.

Runner Splits, Ticket Template

Data fields for the runner and stage are available. Split times come in one collection described below.

  • #geco_RunnerSplits
    • geco_ControlNum : control order (in sequence)
    • geco_ControlTrace : trace computed by Geco (31, -32, +33, +34-35)
    • geco_ControlStatus : trace keyword (time, miss, add)
    • geco_ControlTime
    • geco_SplitTime