Topic on Project:Support desk

Hide Search Bar for single page?

6
Skylance30 (talkcontribs)

We have our wiki set up so that the sidebar isn't shown until after a user logs in. This is our way of securing our wiki from unauthorized users as the permissions way doesn't work. Unfortunately they can still search via the search bar so was trying to find a way to simply hide the search bar for our Main page, is this possible?

This post was hidden by 121.214.54.85 (history)
TheDJ (talkcontribs)

It's a terrible way to protect something, but every page has it's own class on the body of a page, so you can use CSS to display:none the element (and you can place this CSS into your installations MediaWiki:Common.css page)

Ciencia Al Poder (talkcontribs)

Ideally you should implement one of the Hooks about search and throw an exception or abort the search if the user is not logged in. This would catch search from the api, opensearch or direct URL access to the search page. I think Manual:Hooks/SpecialSearchSetupEngine would match all of those entry points.

Ency (talkcontribs)
Infinitepeace (talkcontribs)

To delete the search bar type:

#p-search { display:none; }

In MediaWiki:Common.css

Reply to "Hide Search Bar for single page?"