Topic on Extension talk:WikiEditor

Hide custom sections in namespaces

2
Loman87 (talkcontribs)

Hi,

I am trying to find a method to show my custom toolbar sections only in some namespaces. I know that is possible to show/hide buttons, using the 'filters' parameter; anyway I need to hide an entire section, is that possible? I tried using the 'filters' parameter in the 'section' level, but it didn't work.

Thanks in advance,

Lorenzo

Erutuon (talkcontribs)

How about only adding the toolbar sections in the certain namespaces like this?

if ( [ /* numbers of the namespaces where you want to show the toolbar sections */ ].indexOf( mw.config.get( 'wgNamespaceNumber' ) ) !== -1 ) {
	/* then add the toolbar sections */
}
Reply to "Hide custom sections in namespaces"