UserAvatarLink is a script that turns the avatar image inserted by User Avatar Finder into a clickable link. The link is to a user-specific page belonging to the same user as the avatar (ex. user page or message wall). In order to do this, at most two additional attributes must be added to a User Avatar Finder placeholder.



  • User Avatar Finder


The configuration option (namespace) for this script simply provides a means of altering the default namespace associated with the data-useravatarlink-namespace attribute. The option is a property of the script's configuration object which can be created in a community's JS with the following lines of code.

if (!window.andrewds1021) {
    window.andrewds1021 = {
        user_avatar_link: {}
} else if (!window.andrewds1021.user_avatar_link) {
    window.andrewds1021.user_avatar_link = {};

The configuration option should be set to a string that matches a namespace such that Namespace + ":" + Username is a valid page. To set the default namespace, place a line of code like the following below the code creating the script's configuration object.

window.andrewds1021.user_avatar_link.namespace = "Message Wall";

In the above example, the default namespace is set to Message Wall. Therefore, the script will attempt to link to the user's message wall. If the configuration setting is not set, the script will use User as the default namespace.


In order to create the link, the script must know the namespace and user to link to. This information is provided by adding two attributes to the User Avatar Finder placeholder.


This attribute is used to change the target namespace to something other than the default. As with the configuration setting, the value should a a string that matches a recognized namespace such that Namepsace + ":" + Username is a valid page.


This attribute is used to specify the target user. It should be the target user's username as a string such that Namepsace + ":" + Username is a valid page.


Template:UserAvatarLink is a template that may be copied to a wiki to increase the ease of using this script. The template is a modified version of the template provided for User Avatar Link. The template uses unnamed parameters as summarized in the following table.

Parameter Use
1 target user
2 size of avatar
3 target namespace

Note that this template does not perfectly replicate the behavior of the template for User Avatar Finder. The reason is that a correction has been incorporated for when the template is called without a specified size.


The following examples assume that the script's configuration setting has not been set and, therefore, that User is the default namespace. If you are not able to see the results, you may have disabled the DemoScripts gadget. Go to your preferences and verify that DemoScripts is enabled (the box should have a check mark in it).

Example Default

Template call:



Example 1

Template call:



Example 2

Template call:



Example 3

Template call:



Example 4

Template call:



See also

Text above can be found here (edit)
Community content is available under CC-BY-SA unless otherwise noted.

Fandom may earn an affiliate commission on sales made from links on this page.

Stream the best stories.

Fandom may earn an affiliate commission on sales made from links on this page.

Get Disney+