[Mediawiki-l] Google search on nav bar

Alistair Johnson JohnsonA at rembrandt.co.nz
Fri Nov 11 03:03:08 UTC 2005

Hi Ben,

We hacked up a custom skin for our Intranet mediawiki installation which
includes code to easily search MediaWiki or Google.

There are probably prettier ways, but this worked for us.  Hope it helps.



<!-- script to change between MediaWiki and Google search -->
<script type="text/javascript" language="JavaScript">
function ActionDeterminator()
if(document.searchform.engine[0].checked == true) {
document.searchform.action = '<?php $this->text('searchaction') ?>';
if(document.searchform.engine[1].checked == true) {
document.searchform.action = 'http://www.google.co.nz/search';
document.searchform.method = 'get';
document.searchform.q.value = document.searchform.search.value;
return true;
function entsub(myform) {
  if (window.event && window.event.keyCode == 13) {
  } else {
    return true;
// -->

  	 <form name="searchform" action="<?php $this->text('searchaction')
?>" id="searchform">
      <input name="q" type="hidden" value="">
      <input type="radio" name="engine" checked><font
      <input type="radio" name="engine"><font color="white">The web</font>
	    <input name="search" type="text"
  	  <?php if($this->haveMsg('accesskey-search')) {
	    ?>accesskey="<?php $this->msg('accesskey-search') ?>"<?php }
	    if( isset( $this->data['search'] ) ) {
	    ?> value="<?php $this->text('search') ?>"<?php } ?>
onkeypress="return entsub(this.form)"/>
      <input type='image' name="fulltext"
	    class="searchButton" src="<?php $this->text('stylepath')
?>/<?php $this->text('stylename') ?>/search.gif" alt="Search"
	    value="<?php $this->msg('search') ?>" onClick="return
ActionDeterminator();" />

-----Original Message-----
From: Ben Arnold (DSLWN) [mailto:BenA at datacom.co.nz] 
Sent: Friday, 11 November 2005 12:59 p.m.
To: MediaWiki announcements and site admin list
Subject: [Mediawiki-l] Google search on nav bar

Is it easy to configure MediaWiki so that there is a Google search box on
the navigation bar? It's definitely a nice-to-have, but I think it would be
quite neat if it can be done easily.


MediaWiki-l mailing list
MediaWiki-l at Wikimedia.org

More information about the MediaWiki-l mailing list