MediaWiki auto generates numbers in the table of contents. Is there any way to reference these numbers from inside the sections? For example:
==Section==
==Section==
==Section==
===Sub-Section===
Here in {{VARIABLE}}, we talk about. . .
And have {{VARIABLE}} replaced with 3.1?
If you are familiar with LaTeX, I mean something like \ref{a_section}
.
Here is one possible solution. It requires three files to be placed in [wiki_installation_dir]/extensions/GetSectionNumber/.
GetSectionNumber.php:
GetSectionNumber_body.php:
GetSectionNumber.i18n.php:
Follow the instructions in the comments to install. To use, insert
{{#secnum:$x|$T}}
in the wiki code wherever you want the numbers to appear.$x
is yes/YES/y/Y if you want to turn on auto-incrementing "sub" numbering (like if you are using this in a list, which is what I wanted it for) or N/n otherwise.$T
is the heading title of the section, spelled and spaced exactly as it is between the ='s.