News Details
15.02.2010 20:18
[typoscript] Searchbox
Kategorie: typoscript, RSS Feeds, TYPO3 snippetsVon: larsmessmer
Add nice Searchbox at any page via marker or TV only with TypoScript and CSS.
#TypoScript for Setup lib.searchbox = <span style="color: #000000; font-weight: bold;">COA_INT lib.searchbox { 10 = <span style="color: #000000; font-weight: bold;">TEXT 10.typolink.parameter = {$plugin.tx_indexedsearch.searchUID} 10.typolink.returnLast = url 10.wrap = <!-- searchbox begin --><form name="search" id="search" class="search" action="|" method="post"><label id="searchLabel" for="searchQuery">suchen</label><input type="text" size="15" name="tx_indexedsearch[sword]" id="searchQuery" value="" /><input class="hidden" type="hidden" name="tx_indexedsearch[_sections]" value="0" /><input type="hidden" name="tx_indexedsearch[pointer]" value="0" /><input type="hidden" name="tx_indexedsearch[ext]" value="0" /><input type="hidden" name="tx_indexedsearch[lang]" value="0" /><button class="submit" name="tx_indexedsearch[submit_button]" type="submit" value="search">search</button></form><!-- searchbox end --> # if you need here comes userFunc for exampe ajax search 20 = <span style="color: #000000; font-weight: bold;">USER 20.userFunc = user_functionname 20.userFunc < plugin.name 20.userFunc.cssId = searchQuery } #TypoScript Constants plugin.tx_indexedsearch.searchUID = 25 #CSS Code for box styling /************* search box begin *******************/ .search { clear: right; width: 163px; margin: 5px 0px 0 0; padding: 0; border: 1px solid #DDD; position: relative; line-height: 125%; height: 1.75em; background: #fff url(../img/bg_search.jpg) top right no-repeat; } .searchfocus { background: #fff url(../img/bg_search_over.jpg) top right no-repeat; } .search label { position: relative; display: block; width: 117px; color: #AAA; margin: 0; padding: .25em 4px .25em 20px; background: transparent url(../img/bg_searchlabel.gif) 4px 50% no-repeat; overflow: hidden; font-weight: normal; } .search label.hidden { text-indent: -5000px; } .search #searchQuery { margin: 0; padding: 0; border: none; background: none; position: absolute; top: .25em; left: 20px; width: 117px; height: 1.25em; font-family: Arial, Tahoma, Verdana, Helvetica, sans-serif; font-size: 100%; line-height: 125%; color: #000; } .search #searchQuery:focus { outline: none; } .search .submit { position: absolute; display: block; top: 0; right: 0; bottom: 0; left: 141px; width: 22px; height: 100%; border: none; margin: 0; padding: 0; background: transparent url(../img/bg_searchsubmit.gif) 50% 50% no-repeat; text-indent: -5000px; overflow: hidden; } /************* search box end *******************/
- Links:
- snippets.typo3.org/c/247/
Kommentare zu dieser News
einen Kommentar schreiben

Impressum
Mollio
