1

I'm looking for the way to use nested numbering index of lists in MediaWiki pages. I want to get the following:

1 item "1"
2 item "2"
  2.1 item "2.1"
      2.2.1 item "2.2.1"
      2.2.2 item "2.2.2"
  2.2 item "2.2"
3 item "3"

I've found some CSS/HTML working code for HTML pages but I cannot fit it in a MediaWiki page.

Thanx in advance.

Jdamian
  • 3,015
  • 2
  • 17
  • 22
  • 1
    You can use html to add lists in MediaWiki, so just add the list with `
      `-tags as you wish, give them the classes they need, and add the CSS in `MediaWiki:Commons.css` as you would normally do.
    – leo Jan 25 '16 at 08:42

1 Answers1

1

Something like this should work:

<ol class="nested-list">
    <li>item "1"
    <li>item "2"
        <ol>
            <li>item "2.1"
            <li>item "2.2"
        </ol>
    </li>           
</ol>

And then in MediaWiki:Commons.css (if $wgUseSiteCss is true, as per default), add something like this:

ol.nested-list { counter-reset: item }
ol.nested-list li { display: block }
ol.nested-list li:before { content: counters(item, ".") " "; counter-increment: item }
leo
  • 8,106
  • 7
  • 48
  • 80