Change Numbering in TOC Macro

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Change Numbering in TOC Macro

Mario
There is an example on how to change TOC numbering: http://extensions.xwiki.org/xwiki/bin/view/Extension/TOC+Macro#HExample3:Differentnumberingofsublists
However, it does not work, and even the screenshot on that page does not display the expected result, namely "Level 2" with prefix "1.1"
Can you provide a working example and update the TOC macro documentation? Our desired result is like this: http://i.imgur.com/J1V7Z5n.png (as it was the default in mediawiki)

Thank you,
Mario
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Change Numbering in TOC Macro

Clemens Klein-Robbenhaar


On 10/26/2016 03:03 PM, Hofstätter Mario wrote:
> There is an example on how to change TOC numbering: http://extensions.xwiki.org/xwiki/bin/view/Extension/TOC+Macro#HExample3:Differentnumberingofsublists
> However, it does not work, and even the screenshot on that page does not display the expected result, namely "Level 2" with prefix "1.1"
> Can you provide a working example and update the TOC macro documentation? Our desired result is like this: http://i.imgur.com/J1V7Z5n.png (as it was the default in mediawiki)
>
> Thank you,
> Mario


The toc sample code actually worked for me - mostly; to avoid confusion with a numbered list in the navigation I had to restrict the numbering to the content-area, like:

#xwikicontent ol { list-style-type: none; counter-reset: say; }
#xwikicontent ol li:before { counter-increment: say; content: counters(say,".") ". "; }


Then it worked for me "as advertised" (and yes, not like the screenshot in the docs).

Are you sure the CSS in the Stylesheet is active in the page?
As this is somewhat advanced CSS, maybe it just does not work in your browser?  (unlike the MediaWiki solution, which renders the numbering in the HTML)

Clemens
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Change Numbering in TOC Macro

Mario
This post was updated on .
Clemens Klein-Robbenhaar wrote
to avoid confusion with a numbered list in the navigation I had to restrict the numbering to the content-area, like:

#xwikicontent ol { list-style-type: none; counter-reset: say; }
#xwikicontent ol li:before { counter-increment: say; content: counters(say,".") ". "; }
Thank you, this did the trick. This time, the original example also displayed the numbering, but wrong as you stated. Not sure why it didn't have any effect last time, I tried different browser. I briefly tried different settings for "Caching policy" and "use this extension", but all combinations seem to work now.

I will update the documentation of the TOC macro.

[Update]: The WYSIWYG Editor is to blame on why it didn't work initially, as it is active for the "Code" Property of the StyleSheetExtension. You have to paste the CSS in Source View, or the Editor will destroy the code upon pasting.