Starting a counter in mediawiki without extension

⇠ Back to Blog:Hacks
m
m
Line 52: Line 52:
 
Here's a template of how to get this:
 
Here's a template of how to get this:
  
<nowiki>
 
 
<pre>
 
<pre>
 +
<nowiki>
 
{{multicol}}
 
{{multicol}}
 
# item 1
 
# item 1
Line 63: Line 63:
 
# item 4</div></ol></div>
 
# item 4</div></ol></div>
 
{{multicol-end}}
 
{{multicol-end}}
</pre>
 
 
</nowiki>
 
</nowiki>
 +
</pre>
  
 
{{wl-publish: 2021-01-25 10:10:13 +0000 | Fabrice }}
 
{{wl-publish: 2021-01-25 10:10:13 +0000 | Fabrice }}

Revision as of 15:52, 30 March 2021

Say you want to count like this in mediawiki (not starting at 1):

    1. Three
    2. Four
    3. Five

The internet tells you it's not possible natively and that you need an extension. Here's an ugly hack to do it anyway! (keeping the # rather than going full HTML).

<div style="color:white;">
# <ol start=3><div style="color:black; position:relative; left:-50px;">
# Three
# Four
# Five</div></ol></div>

It's ugly and could break your document! Use with care under desperate circumstances! Here's an example with the multicol template:

which gives me a nicely-ordered, neatly-displayed list of my Mathematics's Wolverhampton lectures of Physics. Fourier Series are covered in Lecture 17!

Here's a template of how to get this:


{{multicol}}
# item 1
# item 2
{{multicol-break}}
<div style="color:white;">
# <ol start=3><div style="color:black; position:relative; left:-50px;">
# item 3
# item 4</div></ol></div>
{{multicol-end}}