Handbuch:Hooks/ShowSearchHit
ShowSearchHit | |
---|---|
Erhältlich ab Version 1.21.0 (Gerrit change 32040) Customize display of search hit. | |
Funktion definieren: | public static function onShowSearchHit( $searchPage, $result, $terms, &$link,
&$redirect, &$section, &$extract, &$score, &$size, &$date, &$related, &$html ) { ... }
|
Haken anbringen: | In extension.json:
{
"Hooks": {
"ShowSearchHit": "MediaWiki\\Extension\\MyExtension\\Hooks::onShowSearchHit"
}
}
|
Angerufen von: | Datei(en): search/searchwidgets/FullSearchResultWidget.php |
Interface: | ShowSearchHitHook.php |
For more information about attaching hooks, see Handbuch:Hooks .
For examples of extensions using this hook, see Category:ShowSearchHit extensions/de.
Details
- $searchPage - Die SpecialSearch-Instanz.
- $result - The SearchResult to show
- $terms - Search terms, for highlighting
- &$link - HTML of link to the matching page. Kann geändert werden.
- &$redirect - HTML of redirect info. Kann geändert werden.
- &$section - HTML of matching section. Kann geändert werden.
- &$extract - HTML of content extract. Kann geändert werden.
- &$score - HTML of score. Kann geändert werden.
- &$size - HTML of page size. Kann geändert werden.
- &$date - HTML of page modification date. Kann geändert werden.
- &$related - HTML of additional info for the matching page. Kann geändert werden.
- &$html - May be set to the full HTML that should be used to represent the search hit. Must include the
<li>...</li>
tags. Will only be used if the hook function returned false.