Search: No input if result

As a result of the content part SEARCH you see the result are displayed just below the search box.

If you would like to see the result displayed without the search input field (search results only) here is a solution.


- Using this code the Input box is set to hidden via css, if a search result was found.

Docu: –
Forum: Display search result on another page

Author: K.Heermann (flip-flop)
CMS Version: >= 1.4x
Version: V1.0 (04.11.2011)


  • $phpwcms['allow_ext_init'] = 1;


File: /template/inc_script/frontend_init/cp_trig_search_no_input_if_result.php


// -------------------------------------------------------------------------------------------
// obligate check for phpwcms constants
if (!defined('PHPWCMS_ROOT')) {die("You Cannot Access This Script Directly, Have a Nice Day.");}
// -------------------------------------------------------------------------------------------
* CP search trigger
* Die Sucheingabe wird ausgeblendet, wenn ein Ergebnis gefunden wurde.
* The search input is hidden, if a match is found.
* 04.11.2011 K.Heermann
    function CP_SEARCH_NO_IPUTFIELD_IF_RESULT($text, & $data) {
        if( $data['acontent_type'] == 13  AND strpos($text, 'phpwcmsSearchResult') !== false ) {    // CP: 13 => search
            $text .= '<!-- CSS: .search_form {display: none;} -->';
    return $text;
english/phpwcms_replacer_rts/frontend_init/cp_trigger/cp-search-no-input-if-result.txt · Last modified: 2018/06/03 18:09 (external edit) Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0