Board Thread:General Discussion/@comment-25956839-20151213211238

The upgrades template, used to display the upgrade costs for cars on their article page has had a makeover, all 133 car page have been updated with the template and now display totals. The existing data is unchanged, all the work to format the car upgrade data is calculated by the template code behind the scenes. When car upgrade costs in R$ or are entered into the upgrade template the costs will automatically format, calculate and total.

Example
There are three parts to the upgrade template, the headings, the data and the total:

Heading
The heading has no input data, it formats the table headings and configures the columns for sorting.

Upgrade Data
the upgrade data takes upto 6 data inputs, separated by a pipe |, for example:

In this example :
 * 1) 1 = The number of the upgrade of the Engine
 * 2) Engine = The component being upgraded, either Engine, Drivetrain, Body, Suspension, Exhaust, Brakes or Tires & Wheels
 * 3) Cold Air Intake = Description of the upgrade (number 3 in the above screen grab)
 * 4) 30 minutes = The length of time the upgrade will take, use the format day(s), hour(s) minute(s) (empty for Gold only upgrades) (number 4 in the above screen grab)
 * 13,500 = R$ upgrade cost, this should be in a value format, either 13500 or 13,500, if the comma separator isn't entered, it will automatically be added (empty for Gold only upgrades) (number 5 in the above screen grab)
 * 1) 3 = Upgrade cost in, this should be in a value format (number 6 in the above screen grab)

Total
In this example :
 * 1) 1 day 17 hours 5 minutes = The total upgrade time, if all upgrades are completed consecutively. It is free text, the total needs to be manually calculated and entered, if empty the total will be blank.

History
This the second template to be created as part of the project to automatically add totals to data. This follows on from the Manufacturers page.

Comments
Any problems or comments, please feel free to post a comment below or on my message wall. Thank you for your support. 