Extension:TableProgressTracking
Release status: beta |
|
|---|---|
| Implementation | Parser extension |
| Author(s) | Telepedia (Original Authoritytalk) |
| Latest version | 1.3.0 (2026/03/21) |
| Compatibility policy | Main branch maintains backward compatibility. |
| MediaWiki | 1.43+ |
| PHP | 8.0+ |
| Database changes | Yes |
| Licence | Apache License 2.0 |
| Download | README |
TableProgressTracking is an extension which allows users to track their progress against certain criteria through MediaWiki tables, such as achievements earned in a game, books read, or episodes watched of a television show.
It is an open-source implementation of the Fandom extension "ProgressTracking", and aims to retain backwards compatibility with that feature set; progress tracking tables created on Fandom's version of the extension should work with this version.
Installation
[edit]- Download and place the file(s) in a directory called
TableProgressTrackingin yourextensions/folder. - Add the following code at the bottom of your LocalSettings.php file:
wfLoadExtension( 'TableProgressTracking' );
Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.
Usage
[edit]To add progress tracking to a MediaWiki table, it simply needs to be wrapped in the <table-progress-tracking></table-progress-tracking> parser tags. An example table is as such:
<table-progress-tracking table-id="1" unique-column-index="1">
{| class="wikitable sortable"
|-
! Column 1 !! Column 2 !! Column 3
|-
| Row1-1 || Row1-2 || Row1-3
|-
| Row2-1 || Row2-2 || Row2-3
|-
| Row3-1 || Row3-2 || Row3-3
|-
| Row4-1 || Row4-2 || Row4-3
|}
</table-progress-tracking>
The extension will automatically add the checkboxes; these are Codex checkboxes added with CSS only styles, therefore this extension requires MediaWiki 1.43 or above.
There are several arguments that can (or must) be passed to the table for it to be displayed:
- table-id
This is a required argument that identifies this table on the article. It must be provided, and it must be an integer. It should be unique on the page and two tables should not share the same table-id (at present, they can, and no error will be thrown, but tracking won't work properly).
- unique-column-index
This argument identifies which column should be used for tracking purposes to identify which of the columns should be checked off. It can be any number between up until the number of columns within the table. It is best if this is set to a column in which the data will not change frequently. If this is set to a value such as "1" then the data in column 1 will be used for tracking purposes. If the value of column 1 changes after the column is checked, then that progress will be lost.
This is not a required argument, however if this is not provided, each row must provide a data-row-id (see below).
- data-row-id
Instead of using a unique column index (as above) you may opt to use a data-row-id. This detaches the tracking from the content inside the table, and is best used where the data in the table may change frequently and is therefore not suitable to be used as an identifier. It is used as such:
<table-progress-tracking table-id="1">
{| class="wikitable sortable"
|-
! Column 1 !! Column 2 !! Column 3
|-
| data-row-id="1" | Row1-1 || Row2-2 || Row3-3
|-
| data-row-id="2" | Row1-1 || Row2-2 || Row3-3
|-
| data-row-id="3" | Row1-1 || Row2-2 || Row3-3
|-
| data-row-id="4" | Row1-1 || Row2-2 || Row3-3
|}
</table-progress-tracking>
If you use data-row-id then you must provide a data-row-id for each row in the table. If this is provided, then this becomes the identifier and even when the data in the table changes, as long as the id for that row is not changed, progress will not be lost.
If you provide both a unique column index and the data row id, the unique column index will be ignored in favour of the data row id.
- header-label
By default, the header for the column where the checkboxes appear will be a Codex check icon. If you do not want this, and wish to provide your own header (such as Completed?) then you may pass a custom header in the header-label argument.
- exclude-row-indexes
Not all rows will need checkboxes for tracking. TableProgressTracking has several ways to exclude a row from being trackable. This is done through the exclude-row-indexes argument passed to the parser tag:
- To exclude known rows, you can pass the indexes to as such, separated by columns
exclude-row-indexes="3;5;9"this will exclude the 3rd, 5th, and 9th row from being tracked; - To exclude all rows after a certain index, use the following syntax
exclude-row-indexes="gt5".[1] This will exclude every row after the 5th row from being tracked. - To exclude all rows before a certain index, use
exclude-row-indexes="lt5"[1]. This will exclude every row before the 5th row from being tracked. Note, usage of this could result in a table with no checkboxes if the row count < the argument passed here.
- location
Some wikis – such as those using RTL languages, or where it makes sense visually – may want to modify the location of the checkboxes relative to the content in the table. This can be done by passing a value to the location argument. Currently, there is only support for either displaying in the first column, or the last.
Using location="last" will place the checkboxes in the last row. Passing any other value will result in the checkboxes in the first column[2]
Limitations
[edit]- There is no validation during the saving of a page with a progress table on it. As such, the page will save, however the table will not render and an error box will display where the table should be (caching will also be disabled for that page until the table is fixed). It is planned to have validation when saving a page in the future.
- There is no cleanup done when a table is removed from an article. This can lead to left over data in the database even when the table is not currently being used.
See also
[edit]- Table Progress Tracking - the Fandom extension that this extension is based on.
References
[edit]- ↑ 1.0 1.1 Note: a better name would not have been "gt/lt", it is unclear what this stands for, but is retained for backwards compatibility with the Fandom version.
- ↑ Note: it may be that a future version of the extension by default places the checkboxes in the last column if the wiki is using a RTL language.
