Extra zoekvenster: verschil tussen versies

Uit MediaWikiGids
Ga naar: navigatie, zoeken
(Code bij gebruik van raw-html)
(Code bij gebruik van raw-html)
Regel 22: Regel 22:
 
<html><form class="" action="/w/index.php" id="searchform">
 
<html><form class="" action="/w/index.php" id="searchform">
 
<div class="form-group input-group">
 
<div class="form-group input-group">
   <span class="input-group-addon glyphicon glyphicon-search"></span>
+
   <span class="input-group-addon"><i class="glyphicon glyphicon-search"></i></span>
 
   <input  id="searchInput" type="search" class="search-query form-control" type="search" accesskey="f" title="Speciaal:Zoeken [ctrl-option-f]" placeholder="Zoeken" name="search" value="" autocomplete="off">
 
   <input  id="searchInput" type="search" class="search-query form-control" type="search" accesskey="f" title="Speciaal:Zoeken [ctrl-option-f]" placeholder="Zoeken" name="search" value="" autocomplete="off">
 
       <span class="input-group-btn">
 
       <span class="input-group-btn">
Regel 34: Regel 34:
 
<html><form class="" action="/w/index.php" id="searchform">
 
<html><form class="" action="/w/index.php" id="searchform">
 
<div class="form-group input-group">
 
<div class="form-group input-group">
   <span class="input-group-addon glyphicon glyphicon-search"></span>
+
   <span class="input-group-addon"><i class="glyphicon glyphicon-search"></i></span>
 
   <input  id="searchInput" type="search" class="search-query form-control" type="search" accesskey="f" title="Speciaal:Zoeken [ctrl-option-f]" placeholder="Zoeken" name="search" value="" autocomplete="off">
 
   <input  id="searchInput" type="search" class="search-query form-control" type="search" accesskey="f" title="Speciaal:Zoeken [ctrl-option-f]" placeholder="Zoeken" name="search" value="" autocomplete="off">
 
       <span class="input-group-btn">
 
       <span class="input-group-btn">

Versie van 25 mrt 2019 om 16:15

De meeste skins voor MediaWiki voorzien in een zoekvenster. Toch is een veel voorkomende vraag naar zoekvensters op flexibele plaatsen in de wikitekst zelf. Standaard voorziet MediaWiki niet in deze behoefte.

Verschillende realisatiemogelijkheden

Er is een drietal verschillende mogelijkheden om een extra zoekvenster te maken:

  • Via de extensie Inputbox
  • Met behulp van de extensie Widgets
  • Met behulp van de extensie waarmee "raw html" mogelijk wordt gemaakt.

Benodigde code

Code bij gebruik van widget

Zie enkele operationele voorbeelden:

Code bij gebruik van raw-html

De vormgeving bij deze voorbeeld-code is gebaseerd op Bootstrap:

<html><form class="" action="/w/index.php" id="searchform">
<div class="form-group input-group">
   <span class="input-group-addon"><i class="glyphicon glyphicon-search"></i></span>
   <input  id="searchInput" type="search" class="search-query form-control" type="search" accesskey="f" title="Speciaal:Zoeken [ctrl-option-f]" placeholder="Zoeken" name="search" value="" autocomplete="off">
      <span class="input-group-btn">
        <button class="btn btn-default" type=“submit” id="mw-searchButton" >OK</button>
      </span>
</div><!-- /input-group -->
</form></html>

Het resultaat is als volgt (NB: alleen als $wgRawHtml = true; in LocalSettings.php