How can I hide the sidebar in MediaWiki?

I would like to be able to hide the entire sidebar (navigation, search, toolbar) and return the space . In other words, the page should expand to fill the space used by the sidebar.

I do not want to do this for each page, but only for certain pages, so it is advisable to use a template.

I have a template that hides the sidebar but, to a decisive extent, does not return space:

<css> #column-content {margin: 0 0 .6em 0;} #content {margin: 2.8em 0 0 0;} #p-logo, .generated-sidebar, #p-lang, #p-tb, #p-search {display:none;} #p-cactions {left: .1em;} #footer {display:none;} </css> 

This is a PageCSS extension.

Does anyone know if I can change this to bring back space - or is there another solution?

Update: After the help of Adrian Archer (see below), I found that the problem is in my configured skin. Space Recovery works with Monobook . Does anyone know which private part of the single-skin leather I need to copy? I tried a few things and I think it is in main.css , but I'm not sure.

+4
source share
3 answers

Thanks to the help of Adrian Archer (see his answer) + the hard work of a colleague, I have a working example (maybe it works for all skins). Create a template (e.g. Template:Hide sidebar ) with this content:

 <css> #column-content {margin: 0 0 .6em 0;} #content {margin: 2.8em 0 0 0;} #p-logo, .generated-sidebar, #p-lang, #p-tb, #p-search { display:none; } #p-cactions { left: .1em; } #footer { display:none; } #mw_content { margin-left:0.2em; } </css> 

Then just add {{Hide sidebar}} to any page you {{Hide sidebar}} . The sidebar area will be restored to the page. This difference with my question is the second to last line: #mw_content { margin-left:0.2em; } #mw_content { margin-left:0.2em; }

+3
source

Try putting your code in Common.css to make sure it is correct.

The only thing I can think of is the problem (and I'm not a CSS expert) is that it is loading at the wrong time. Try putting it in a template, doesn't it work?

+1
source

Maybe the answer is a bit late ..

Entering the following line in MediaWiki: Common.css hides the navigation bar on all pages

 #mw-panel .body { visibility: hidden; } 

or

 #mw-panel .body { opacity: 0; } 

To hide the panel on a specific page, add

 .page-Pagename #mw-panel .body { visibility: hidden; } 

"Pagename" is the name of the page (capitalized). Be very careful when editing the MediaWiki: Common.css page!

0
source

All Articles