AddRailModule

AddRailModule adds a custom module to your wiki's side rail. By default, it adds the contents of Template:RailModule towards the bottom of the side rail, just above the recommendations module ("Others like you also viewed" or "Popular Pages") or sticky modules ("Page Tools" or "Recent Wiki Activity"). With configuration, multiple modules can be added, and up to two modules can be placed towards the top of the side rail (just below the top ads module). Each module is wrapped in a section.railModule.rail-module.
There is a limit to the number and height of the allowable rail modules. The height of the overall size of added rail modules should not be taller than the regular rail modules. Also, only one rail module is allowed to be above (prepended) the Recent Wiki Activity module.
== ==
== ==
To add the contents of Template:RailModule as a module towards the top of the side rail, add this to your Common.js:
window.AddRailModule = [{prepend: true}];
To add multiple modules (e.g., the contents of Template:Foo, Template:Bar, and Template:Baz) towards the bottom of the side rail:
window.AddRailModule = ['Template:Foo', 'Template:Bar', 'Template:Baz'];
To add multiple modules towards both the top and bottom of the side rail:
window.AddRailModule = [
 {page: 'Template:Foo', prepend: true},
 'Template:Bar',
 'Template:Baz',
];
Note: If you specify more than two modules for prepending, only the first two will be honored.
The contents of each module may be cached for up to maxAge seconds. By default, this is 300 seconds (five minutes). If your module is short-lived—i.e. it updates often (like polls), or is random in nature, or relies on page name variables like {{PAGENAME}}—then set maxAge to 0 seconds. Conversely, if your module is long-lived, then maxAge can be set up to 86,400 seconds (one day).
== Styling ==
To target all custom modules, use the selector .railModule.
To target specific custom modules, consider wrapping the contents of each module in their own unique container element in your templates, and selecting that instead.
== Forks ==
=== NewPagesModule ===
After you've installed the script, copy the following contents to the Template:NewPagesModule page on your wiki:
Also import the script's stylesheet to customize the module:
And add your template to following parameters (in addition to those already connected; if there are none, then only one template):
window.AddRailModule = ['Template:Foo', 'Template:Bar', 'Template:Baz', 'Template:NewPagesModule'];