A partial archive of https://discourse-mediawiki.wmflabs.org as of Saturday May 21, 2022.

VisualEditor toolbar and source viewing and make it available for other namespace

extarys

I love the VisualEditor (most of it) but I’d like to use it everywhere, in every namespace.

Also, the toolbar is a bit messy for my taste, I like having the Bold, Italic and Underline option visible with the swith on the right for the Source Editing visible for easy switching.

Third issue I’m having is once I’m in the Edit source (from the wiki) or Source editing (from within the VisualEditor, I’m on the default source edit page, not in VisualEditor. I’ve install an extension for syntax highlighting too and I’ve read it is compatible. I’d love this as it would make things easier.

My configuration looks like this (a bit messy I don’t know what everything is doing):

$wgVisualEditorShowBetaWelcome = false;
$wgVisualEditorAvailableNamespaces = [
    NS_MAIN => true,
    NS_USER => true,
    NS_PROJECT => true,
    NS_HELP => true,
    NS_MEDIAWIKI => true,
    NS_TEMPLATE => true,
    "_merge_strategy" => "array_plus"
];
$wgVisualEditorEnableWikitext = true;
$wgVisualEditorDisableForAnons = true;
$wgDefaultUserOptions['visualeditor-enable'] = 1;
$wgVisualEditorEnableExperimentalCode = true;
$wgDefaultUserOptions['visualeditor-enable-experimental'] = 1;
$wgVisualEditorEnableWikitext = true;
$wgDefaultUserOptions['visualeditor-newwikitext'] = false;

If someone have the time to help me a little with the configuration. I noticed even if I’m using the latest version of everything, Wikipedia looks way better hahaha.

cheers :sunny:

EDIT: This was in the wrong category. Moved to “Ask here”

Alex_brollo

Consider too, that a few users perhaps hate VisualEditor, so keep in evidence an option to disable it everywhere with one click, please. :smile:

extarys

Sure thing!

I hate it too to be honest but I hate more the default editor which doesn’t feature syntax highlight and a 1995 toolbar :stuck_out_tongue:

EDIT: I tried installling the wikiEditor, I think it might be more useful than the VisualEditor but it didn’t worked.

qgil

Hi, can you create one topic per question, please? Otherwise it becomes more difficult to answer. Thank you!

Tgr

Are the $wgVisualEditorAvailableNamespaces settings not working for you? Or are you just looking for a way to enable it in every namespace without having to list all of them? That would be something like $wgVisualEditorAvailableNamespaces = array_fill_keys( MWNamespace::getValidNamespaces(), true );.

kghbln

While we are at $wgVisualEditorAvailableNamespaces:

Setting the following works for an namespace with the constant NS_EXTRA:

$wgVisualEditorAvailableNamespaces = [
    NS_EXTRA => true
];

However, how does one exclude pre-included namespaces?

Tgr

Looking at extension.json it actually uses canonical names, not namespace numbers, so that’s probably why it’s not working for you.

kghbln

Ah, that’s it. Thanks a lot! I actually saw this but since all of MediaWiki core and all other extensions I know use the constants I did not get it even though it was directly in front of my eyes. I wonder why VisualEditor introduced yet anther variation. Moreover the current docu increases confusion.

So this is the setting I was looking for adding namespace “Extra” and removing “File” and “Category” (in “consistency mode” ;):

$wgVisualEditorAvailableNamespaces = [
        "File" => false, 
        "Category" => false, 
        "Extra" => true
        ];

I will update the docu.

kghbln

Now documented in a better way I believe.