Release status: stable |
|
|---|---|
| Implementation | Parser function |
| Description | Allows to auto count objects in a page |
| Author(s) | (Rinicktalk) |
| Latest version | 0.2.1 (2023-04-11) |
| MediaWiki | 1.39+ |
| Database changes | No |
| License | Mozilla Public License 2.0 |
| Download | GitHub: |
|
Hooks used
|
|
The Counter extension allows to auto count objects in a page.
If you change some item to {{#+: item}} you can get the number of item in this article with {{#+: ? item}}
Installation
- Download and place the file(s) in a directory called
Counterin yourextensions/folder. - Add the following code at the bottom of your LocalSettings.php file:
wfLoadExtension( 'Counter' );
Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.
Usage
| Description | You type | You get |
|---|---|---|
| Basic usage | ||
| simple counter |
* Alice: {{#+: agree}}
* Bob: {{#+: agree}}
* Carol: {{#+: disagree}}
* Dave: {{#+: agree}}
* Eve: {{#+: disagree}}
* Isaac: {{#+: agree}}
total:
* '''{{#+: ? agree}} '''
* '''{{#+: ? disagree}}'''
|
total:
|
| simple counter with numbers |
# {{#+: 1 person}}
# {{#+: 2 person}}s
# {{#+: 3 person}}s
total: '''{{#+: ? person}}s''' <br />
|
total: 6 persons |
| a, an, one, two...twenty |
{{#+:1 apple}} + {{#+:1 apple}} + {{#+:1 apple}} + {{#+:2 apple}}s <br />
= '''{{#+:? apple}}s'''
|
apple + apple + apple + 2 apple |
This article is issued from Mediawiki. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.