FANDOM


AddSectionButton is a JavaScript extension that appends an "Add Section" button to the Edit dropdown that creates a new section for the user to edit, much like on talk pages.

Installation

Importing multiple scripts? This quick guide shows how to combine the imports.
  • For site-wide use, an administrator can add the line below to the wiki's MediaWiki:ImportJS page.
dev:AddSectionButton/code.js
  • For personal use, add the code snippet below to your global.js page (for use on all wikis) or your common.js page on your wiki (for use on a single wiki). Note that personal JS must be enabled for your account.
importArticles({
    type: 'script',
    articles: [
        'u:dev:MediaWiki:AddSectionButton/code.js',
    ]
});

Customization

The text of the button can be customized through the following code:

window.AddSectionButtonText = 'test';

Replace test with the desired text. The customized text must be placed before the import, or else the button will use its default text.

This would work:

window.AddSectionButtonText = "Add new section";
importArticles({
    type: 'script',
    articles: [
     'u:dev:MediaWiki:AddSectionButton/code.js'
    ]
});

This would NOT work:

importArticles({
    type: 'script',
    articles: [
     'u:dev:MediaWiki:AddSectionButton/code.js'
    ]
});
 
window.AddSectionButtonText = "Add new section";
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+