FANDOM


Note: The buttons may be buggy and may sometimes not appear. You are invited to try to fix these buttons.
Note²: The Discussions API/framework is not officially supported. The API may change at any moment, resulting in the script breaking.

DiscussionsButtons are fully customizable buttons on each post and reply in Discussions.

Installation

It is recommended to use CustomizeDiscussions to import the script.

Since this script is fully customizable, you need to preset your buttons. There is no limit to the buttons, but they will all be on one line, so choose wisely! They will change width accordingly.

Example:

window.DiscussionsButtonsCustom = {
  "Contribs": "/Special:Contribs/$1",
  "Block": "/Special:Block/$1",
  "User": "/d/u/$2",
  "Wiki": "https://$3.fandom.com"
}

First, the script uses an array to create these buttons. The first thing in the object, IE Contribs, is the display text for the button. The second thing is the actual <a href> link.

You can use shortcuts like you would in a a href tag, such as shortening the link to /Special:Action instead of https://dev.fandom.com/wiki/Special:Action.

There are three variables you can use to create these links;

  • $1: Username
  • $2: User ID
  • $3: Wiki URL (Just the dev part in https://dev.fandom.com)

Add this import below the variable you just created:

$.getScript("https://dev.fandom.com/index.php?title=MediaWiki:DiscussionsButtons.js&action=raw&ctype=text/javascript");

See also

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+