sg_search

Such Plugin

Folgendes ins Template

Constants:

plugin.tx_sgsearch.IDofResultPage = 51

Setup:

# ------------------------------------
# SG Search: Setup
# ------------------------------------
plugin.tx_sgsearch.result {
    range = 5
   
    # 0=Input is treated as ONE item; 1=Items are ANDed 2=Items are ORed
    searchMode = 1
   
    #renderWrap = <div>###TYPETITLE### (###TYPECOUNT###)</div>|
    renderWrap =
    renderMore = <div>|</div>
    renderSummary = <div>|</div>
   
    renderObj {
        10.wrap = <h3 class="csc-searchResultHeader">|</h3>
        20.stdWrap.wrap = <p class="csc-searchResult">|</p>
    }
   
    summary {
        wrap = <div>|###RESULT###</div>
        10.wrap = <div>|</div>
    }
   
    layout = COA
    layout {
        10 = TEXT
        10.value =

        15 = TEXT
        15.data = LLL:EXT:sg_search/pi/locallang.php:search.resultRange
        15.fontTag =
        15.wrap =  <div class='csc-searchResultTitle'>|</div>
       
        20 = TEXT
        20.data = LLL:EXT:sg_search/pi/locallang.php:search.prevNext
        20.fontTag =
        20.wrap = <div class="csc-searchTopPaging">|</div>

        50 = TEXT
        50.value = ###RESULT###

        75 = TEXT
        75.value =
       
        80 = TEXT
        80.data = LLL:EXT:sg_search/pi/locallang.php:search.prevNext
        80.fontTag =
        80.wrap = <div class="csc-searchBottomPaging">|</div>
       
        90 = TEXT
        90.value = 
    }

    noResultObj = COA
    noResultObj {
        10.fontTag =
        10.wrap = <div>|</div>
        wrap = <p class="csc-searchNoResult">|</p>
    }
   
    next = TEXT
    next.data = LLL:EXT:sg_search/pi/locallang.php:search.searchResultNext
   
    prev = TEXT
    prev.data = LLL:EXT:sg_search/pi/locallang.php:search.searchResultPrev
}

# ------------------------------------
# SG Search: Searchbox on top
# ------------------------------------
plugin.tx_sgsearch.searchform {
    showOnResultPage =
    showOnSearchPage =  
    wrap (
        <form action="index.php" method="get"><input type="hidden" name="no_cache" value="1" />
        <input type="hidden" name="id" value="{$plugin.tx_sgsearch.IDofResultPage}" />
        |
        </form>
    )
    content (
                ###SEARCH_WORD###
                <input type="hidden" name="tx_sgsearch[how]"  value="detail">
                <input type="hidden" name="tx_sgsearchs_and_or_type"  value="and">
                <input type="hidden" name="tx_sgsearch[where][]"  value="page">
            ###SEARCH_HIDDEN###
                <input name="Abschicken" src="fileadmin/layout/images/button_lupe.gif" style="border:0;" type="image" alt="">
    )
   
    search.word {
        default = LLL:EXT:sg_search/pi/locallang.php:search.default
        onclick = onfocus="if (this.value==this.defaultValue) this.value=''"
        content = <input class="topsuchfeld" type="text" value="###sword###" ###more###  name="tx_sgsearch[sword]" size="20" >
    }
}
# ------------------------------------
# SG Search: Plugin on page
# ------------------------------------
plugin.tx_sgsearch.form {
    wrap (
        <div class="searchbox">
        <form action="index.php" method="get">
        <input type="hidden" name="no_cache" value="1" />
        <input type="hidden" name="id" value="{$plugin.tx_sgsearch.IDofResultPage}" />
        |
        </form>
        </div>
    )
    content (
        ###SEARCH_WORD###
        <input type="hidden" name="tx_sgsearch[how]"  value="detail">
        <input type="hidden" name="tx_sgsearchs_and_or_type"  value="and">
        <input type="hidden" name="tx_sgsearch[where][]"  value="page">
        ###SEARCH_HIDDEN###
        <input name="Abschicken" src="fileadmin/layout/images/button_lupe.gif" style="border:0;" type="image" alt="">

    )
}

plugin.tx_sgsearch {
   
    sgSearchFunc =

}

Einbinden

    # ----------  RSYS_SEARCH----------
    RSYS_SEARCH = PHP_SCRIPT
    RSYS_SEARCH.file = {$plugin.tx_sgsearch.searchform}
    # --- end  RSYS_SEARCH  

Statisches Template includieren

Plugin einfügen:

CODE: result

Bugs

Javascript Fehler in prg/class.tx_sgsearch_FormClass.inc:

function doSearchForm(

  //$onkeyup = 'onkeyup="word=this.value;....
  $onkeyup = ''; // rsys modified: 'onkeyup="tx_sgsearchCursors(event); " onblur="tx_sgsearchprocessFormData(\'\')"';

  // rsys modified: autocomplete..not W3C Conform (find tag autocomplete and delete)
  ....

function addJsSgSearchFunctions () {
        if (!$this->addedJsSgSearchFunctions) {
            $this->addedJsSgSearchFunctions = TRUE;
            if ($GLOBALS['TYPO_VERSION']<SGZ_VERSIONFORADDJS) {
                return ''; // rsys modified: '<script src="'.$this->sgSearchFunc.'" type="text/javascript">'."\r\n".'</script>'."\r\n";
   

Erstellt: 07/2010| Geändert: 10/2015