简体   繁体   中英

How can I hide or remove a div class of a special page powered by MediaWIki?

I am trying to remove the circled section in this picture :

The picture is a special page powered by MediaWiki and I cannot edit it in the same way as normal wiki pages. Instead, I am able to access its php file, and have found a function I believe to be responsible for setting up the page:

/**
 * Sets up everything for the HTML output page including styles, javascript,
 * page title, etc.
 *
 * @param string $term
 */
protected function setupPage( $term ) {
    $out = $this->getOutput();

    $this->setHeaders();
    $this->outputHeader();
    $out->allowClickjacking();
    $this->addHelpLink( 'Help:Searching' );

    if ( strval( $term ) !== '' ) {
        $out->setPageTitle( $this->msg( 'searchresults' ) );
        $out->setHTMLTitle( $this->msg( 'pagetitle' )
            ->plaintextParams( $this->msg( 'searchresults-title' )->plaintextParams( $term )->text() )
            ->inContentLanguage()->text()
        );
    }

    $out->addJsConfigVars( [ 'searchTerm' => $term ] );

    $out->addModules( 'mediawiki.special.search' );
    $out->addModuleStyles( [
        'mediawiki.special', 'mediawiki.special.search.styles', 'mediawiki.ui', 'mediawiki.ui.button',
        'mediawiki.ui.input', 'mediawiki.widgets.SearchInputWidget.styles',
    ] );

}

However, I am not sure of what changes I can make to hide/remove the search bar. I was hoping to find a piece of HTML code where I can edit, but I was not able to find it.

The easiest way to hide elements is to use jquery. More Information see here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM