Manual:フック/ShowSearchHit

From mediawiki.org
This page is a translated version of the page Manual:Hooks/ShowSearchHit and the translation is 64% complete.
ShowSearchHit
バージョン 1.21.0 (Gerrit change 32040) から利用可能
Customize display of search hit.
関数の定義:
public static function onShowSearchHit( $searchPage, $result, $terms, &$link, 
&$redirect, &$section, &$extract, &$score, &$size, &$date, &$related, &$html ) { ... }
フックのアタッチ: extension.json 内:
{
	"Hooks": {
		"ShowSearchHit": "MediaWiki\\Extension\\MyExtension\\Hooks::onShowSearchHit"
	}
}
呼び出し元: ファイル: search/searchwidgets/FullSearchResultWidget.php
インターフェイス: ShowSearchHitHook.php

フックの設定についての詳細情報は Manual:フック を参照してください。
このフックを使用する拡張機能の例については、Category:ShowSearchHit extensions/ja を参照してください。

詳細

  • $searchPage - SpecialSearch インスタンス。
  • $result - 表示する SearchResult
  • $terms - 検索語句、強調表示用
  • &$link - HTML of link to the matching page. 変更される場合があります。
  • &$redirect - リダイレクト情報の HTML。 変更される場合があります。
  • &$section - HTML of matching section. 変更される場合があります。
  • &$extract - HTML of content extract. 変更される場合があります。
  • &$score - スコアの HTML。 変更される場合があります。
  • &$size - ページ サイズの HTML。 変更される場合があります。
  • &$date - HTML of page modification date. 変更される場合があります。
  • &$related - HTML of additional info for the matching page. 変更される場合があります。
  • &$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.