Global Lua Modules/Context-link

Context-link allows for the creation of context-links templates (brief text providing suggestions for another page for further reading) which can take an infinite number of arguments.

An infinite amount of links and alternative text tied to links can be added through the template, in addition to a desc parameter for the descriptive text and a parameter for additional text. The template also supports adding any extra CSS classes or styles. Links can point to any namespace.

How to install
Context-link is designed to create both individual and standalone templates.

Module
To enable the module on your wiki, simply create a module titled Module:Context-link or otherwise, containing the following:

CSS
Context-link uses a single CSS class to control its appearance. Add the following code anywhere in your Wikia.css:

You can edit as desired to control its appearance.

Simple
A simple usage would be:

results in:

This is all a context-link requires to function.

Multiple arguments
A more complex use goes as follows:

results in:

There are many different use cases for multiple arguments being given. Each of these arguments can also have text display attached to it.

However, be aware that in the vast majority of cases, adding text displays to links should be avoided. This is because the name of the article is often descriptive enough.

Styles
If additional styling is desired:

results in:

This allows additional control over the appearance of the templates. It is not possible to use  to override link appearances, though it can be possible with the use of the correct

Once again, this should not be required in the vast majority of cases. A simpler appearance is preferred.

As a template
This is the most common use case.

In the majority of use cases, a context-link with a common set text will be required, with infinite functionality. However, the base template cannot be used to construct context-link templates which share its functionality but have a set description.

Instead, the context-link module should be invoked without the use of the template.

As an example: will create a context-link template that can still take infinite arguments and infinite text displays.

This is the most optimal and common use of the context-link module.