[Mediawiki-l] Hide specific/unused namespaces from « Search in Namespaces » box

Daniel Friesen dan_the_man at telus.net
Thu Sep 25 02:40:27 UTC 2008


Erm... what about:

#mw-search-ns93, label[for=mw-search-ns93] { display:none; }

No need to screw with php to hide something that can be done with css.

~Daniel Friesen (Dantman, Nadir-Seen-Fire)
~Profile/Portfolio: http://nadir-seen-fire.com
-The Nadir-Point Group (http://nadir-point.com)
--It's Wiki-Tools subgroup (http://wiki-tools.com)
--The ElectronicMe project (http://electronic-me.org)
-Wikia ACG on Wikia.com (http://wikia.com/wiki/Wikia_ACG)
--Animepedia (http://anime.wikia.com)
--Narutopedia (http://naruto.wikia.com)



Wikimini wrote:
> Ok, I finally found a solution that will only display 5 namespaces in the
> "Search in namespaces" box.
> #################################################
>
>   
>>> In the file includes/specials/SpecialSearch.php (Mediawiki 1.13)
>>>       
>
> BEFORE
>
> $namespaces .= Xml::openElement( 'span', array( 'style' => 'white-space:
> nowrap' ) ) .
>
> ADD
>
> if (($ns == "0" ) or ($ns == "1" ) or ($ns == "2" ) or ($ns == "3" ) or ($ns
> == "6" ) {
>
> and AFTER
>
> Xml::closeElement( 'span' ) . "<br />\n";
>
> ADD
>
> }
>
> #################################################
>
> I know this solution is not very elegant but it works.
>
> Laurent
>
>
>
> 2008/9/25 Wikimini <webmaster at wikimini.org>
>
>   
>> Hi,
>> Thank you for the quick answer. I added the following in my stylesheet:
>>
>> #mw-search-ns93 {display:none;
>> }
>>
>> It hides the checkbox but not its label (checkbox text). Is there a way to
>> hide the label too? Sorry, I'm not a CSS guru.
>>
>> Kind regards.
>>
>> Laurent
>>
>>
>> 2008/9/25 Platonides <Platonides at gmail.com>
>>
>> Wikimini write:
>>     
>>>> Hi,
>>>>
>>>> First, sorry for my poor english.
>>>>         
>>> Don't worry.
>>>
>>>       
>>>> I've created a wiki for children and the « Search in Namespaces » box
>>>>         
>>> brings
>>>       
>>>> too much confusion for them. Namespaces like « MediaWiki  »,
>>>> « MediaWiki_talk », « Template », « Portal », … are not of any
>>>>         
>>> importance to
>>>       
>>>> them.
>>>>
>>>>  I would like some namespaces NOT TO BE SHOWN in the « Search in
>>>> Namespaces » box. I've been looking all over the Internet but didn't
>>>>         
>>> find
>>>       
>>>> any solution. $wgNamespacesToBeSearchedDefault<
>>>>         
>>> http://www.mediawiki.org/wiki/Manual:$wgNamespacesToBeSearchedDefault
>>>       
>>>> doens
>>>> not seem to do what I need. I
>>>> surely could do that by customizing the SpecialSearch.php page but I'm
>>>>         
>>> not
>>>       
>>>> sure what to do exactly. I would be very grateful to anyone who could
>>>>         
>>> help
>>>       
>>>> me manage that.
>>>>
>>>> I'm using Mediawiki 1.13
>>>>
>>>> Kind regards.
>>>>
>>>> Laurent
>>>>         
>>> Each of them has an id (mw-search-ns1, mw-search-ns2, mw-search-ns3...)
>>> Just use CSS (Mediawiki:Common.css) to hide the unwanted ones.
>>>
>>>
>>> _______________________________________________
>>> MediaWiki-l mailing list
>>> MediaWiki-l at lists.wikimedia.org
>>> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>>>       
>>     
>
>
>   


More information about the MediaWiki-l mailing list