Difference between revisions of "MediaWiki/archive/customizing/searchbox"

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
Jump to navigation Jump to search
m (post-move tweaks)
m (→‎{{hide|navbar}}: navbar tweaks)
Line 1: Line 1:
 
=={{hide|navbar}}==
 
=={{hide|navbar}}==
 
{{web software|MediaWiki}}: [[MediaWiki customization|customization]]: [[modifying the MediaWiki searchbox]]
 
{{web software|MediaWiki}}: [[MediaWiki customization|customization]]: [[modifying the MediaWiki searchbox]]
 +
 
==Notes==
 
==Notes==
 
The key which modifies both the title of the search form and the text on the button is "search" ([[MediaWiki:search]]). In order to change one without changing the other, find the following code in MonoBook.php (and any other skins you want to work the same way):
 
The key which modifies both the title of the search form and the text on the button is "search" ([[MediaWiki:search]]). In order to change one without changing the other, find the following code in MonoBook.php (and any other skins you want to work the same way):

Revision as of 14:12, 23 August 2006

navbar

computing: software: web: MediaWiki: customization: modifying the MediaWiki searchbox

Notes

The key which modifies both the title of the search form and the text on the button is "search" (MediaWiki:search). In order to change one without changing the other, find the following code in MonoBook.php (and any other skins you want to work the same way):

	<div id="p-search" class="portlet">
	  <h5><label for="searchInput"><?php $this->msg('search') ?></label></h5>
	  <div class="pBody">
	    <form name="searchform" action="<?php $this->text('searchaction') ?>" id="searchform">
	      <input id="searchInput" 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 } ?> />
	      <input type='submit' name="go" class="searchButton" id="searchGoButton"
	        value="<?php $this->msg('go') ?>"
	        /> <input type='submit' name="fulltext"
	        class="searchButton"
	        value="<?php $this->msg('search') ?>" />
	    </form>
	  </div>
	</div>

Modify the last "value=" line:

value="<?php $this->msg('searchbutton') ?>" />

Then set Mediawiki:searchbutton to the text you want on the button.