Activate and customize “Table of contents” macro in IBM Connections Wiki

Last Update:

Author: Christoph Stoettner
Read in about 3 min · 520 words


Photo by David Travis | Unsplash

I have read about a new function in IBM Connections Wiki, which I missed until now. A new macro to create a table of contents within a wiki page.

The activation of this macro is documented here: Wikis configuration properties


Specifies whether macros are enabled in Wikis. You can use macros to automate common tasks, such as generating a table of contents in a wiki page. The default value of this parameter is false. To enable macros, set the value to true. When enabled, macros are available from the Macros menu in the editor toolbar.


I’m a little confused (the config option should be editor.wikimacros.enabled).


      <wikitexttab enabled="true" />
      <wikimacros enabled="true" /> <!-- add this line -->

After checking in the configuration file and restart connections I got a new button in my wikis’ editor:

Macro for Table of Contents

Quite cool, but the macro only generate headings with format h2, h3 and h4 to the TOC. The Richtext editor provides headings h1-h4. I want to change this behavior, that h1 will be added to TOC too.

I found a great article on adding templates to CKEditor from Rob Novak , there he describes how you can customize the CKEditor of wikis. I used the paths mentioned in this article to customize the TOC behavior.

Extract toc.js

You can find the needed file in your shared directory, e.g. /opt/IBM/Connections/data/shared/provision/webresources. I extracted it to /tmp:

unzip -d /tmp/ckeditor /opt/IBM/Connections/data/shared/provision/webresources/

Create customization path and copy toc.js

mkdir -p /opt/IBM/Connections/data/shared/customization/javascript/lconn/wikis/macros
cp /tmp/ckeditor/resources/macros/toc.js /opt/IBM/Connections/data/shared/customization/javascript/lconn/wikis/macros

Change toc.js

vim /opt/IBM/Connections/data/shared/customization/javascript/lconn/wikis/macros/toc.js

You find the following part:

lconn.wikis.macros.toc = {
//node id sequence for TOC link.
    fragmentSeqn: 1,
    topLevel: 2,
    bottomLevel: 4,
    template: 'Table of Contents:<INSERT-BODY>',

You have to change topLevel and bottomLevel to following:

lconn.wikis.macros.toc = {
//node id sequence for TOC link.
    fragmentSeqn: 1,
    topLevel: 1,
    bottomLevel: 5,
    template: 'Table of Contents:<INSERT-BODY>',

After a new Connections restart my toc got updated with h1 – h5.


Change Styles

If you want to change the default style of your tocs, you can do this in the toc.js file too! I prefer my TOC on the right screen side and with a light grey not yellow background.

I changed:

 style: 'border-radius: 6px; margin: 8px; padding: 4px; display: block; width: 50%;background-color: #ffc;',


 style: 'border-radius: 6px; margin: 8px; padding: 4px; display: block; width: 30%;background-color: #E0E0E0;float:right;padding:10px;margin-left:20px;margin-bottom:20px;',

Now i have a little bit smaller toc with additional space to the content:

Changing the style of your toc

It would be better to define the styles through a CSS file in the customization folder, but I only wanted to test it. When you want to change through a CSS file, then you should remove most of the styles from the line starting with: style:.

Update 2022-07-11

I tested the configuration today with Connections 7.0 and installed CFix.70.2206. Except of the jar name, which is now, the whole process to enable and customize is still working. After changing wikis-config.xml the Macros > Table Of Contents button appears in all Connections editors (CKEditor, and TinyMCE)!

Add a comment
There was an error sending your comment, please try again.
Thank you!
Your comment has been submitted and will be published once it has been approved.

Your email address will not be published. Required fields are marked with *

Suggested Reading
Aaron Burden: Fountain pen and a notebook
The Default Page of Wikis shows some content for our users to offer them better work experience, but in some companies it would be good to change this text or use only one language. Content of this welcome page is set in the default language of the user who creates the wiki. I found the properties File for this text area in {WAS_Root}/profiles/AppSrv01/installedApps/{cellname}/Wikis.ear When you unzip the file, you get the path com/ibm/lconn/share/services/handlers/wiki/nls/ and there the properties-files for wikis ( To change the values for english, you create a file named in {Connections Shared Directory}/customization/strings/ Here you define:
Last Update:
Read in about 1 min
Aaron Burden: Fountain pen and a notebook

Wikis in IBM Connections 5.5 have a little bug, because the link (/library instead of /wikis/form/api/library) for images are wrong and so they are not displayed.

Last Update:
Read in about 2 min
Aaron Burden: Fountain pen and a notebook
Last week i searched a way to send all Connections users an information on important updates, which should be configurable and uses cookies to hide it for a specific time. First i had a look at the Greenhouse Announcement Widget which is used within Greenhouse . Quite nice, but i had problems with IE 9 users and the popup appears on each page you open within Connections. So i tried something other. After some searching i found a script of Ollie Phillips which is originally used to inform users about Cookie usage on the site. Ollie published the cookiesDirective.js under the MIT License.
Last Update:
Read in about 2 min