Suchformular auf jede Seite einbinden

Armin Bartsch, Mittwoch, 24. Juni 2009

Eine einfache Möglichkeit um auf jeder Seite ein Suchformlar einzubinden

TypoScript

lib.menue_sub = COA lib.menue_sub.10 { 10 = TEXT 10 { # Gesamter Form Wrap outerWrap.cObject = COA outerWrap.cObject { 10 = TEXT 10 { typolink.parameter = 310 typolink.returnLast = url wrap = <div id="indexedsearchbox"><form action="|" method="post" ><fieldset><legend>Suche</legend> } 20 = TEXT 20 { value = | </fieldset></form></div> } } value ( <input name="tx_indexedsearch[sword]" value="" class="searchbox-sword" type="text" /> <input type="hidden" name="tx_indexedsearch[sections]" value="0" /> <input name="tx_indexedsearch[submit_button]" value="Search" type="hidden" /> <input type="submit" value="Los" class="submit"> ) } }
  1. lib.menue_sub = COA
  2. lib.menue_sub.10 {
  3.   10 = TEXT
  4.   10 {
  5.     # Gesamter Form Wrap
  6.     outerWrap.cObject = COA
  7.     outerWrap.cObject {
  8.       10 = TEXT
  9.       10 {
  10.         typolink.parameter = 310
  11.         typolink.returnLast = url
  12.         wrap = <div id="indexedsearchbox"><form action="|" method="post" ><fieldset><legend>Suche</legend>
  13.       }
  14.       20 = TEXT
  15.       20 {
  16.         value = | </fieldset></form></div>
  17.       }
  18.     }
  19.     value (
  20.       <input name="tx_indexedsearch[sword]" value="" class="searchbox-sword" type="text" />
  21.       <input type="hidden" name="tx_indexedsearch[sections]" value="0" />
  22.       <input name="tx_indexedsearch[submit_button]" value="Search" type="hidden" />
  23.       <input type="submit" value="Los" class="submit">
  24.     )
  25.   }
  26. }

CSS

#indexedsearchbox input { /* Alle Labels UND Formularelemente auswählen */ display: block; float: left; width: 150px; /* Breite.*/ } #indexedsearchbox form br { /* Alle Zeilenumbrüche in Formularen auswählen */ clear: left; /* das floating der labels und inputs aufheben */ } #indexedsearchbox .submit { /* den Submit-Button */ float: none; padding-left:10px; width: 40px; }
  1. #indexedsearchbox input { /* Alle Labels UND Formularelemente auswählen */
  2.   display: block;
  3.   float: left;
  4.   width: 150px; /* Breite.*/
  5. }
  6.  
  7. #indexedsearchbox form br { /* Alle Zeilenumbrüche in Formularen auswählen */
  8.   clear: left; /* das floating der labels und inputs aufheben */
  9. }
  10.  
  11. #indexedsearchbox .submit { /* den Submit-Button */
  12.   float: none;
  13.   padding-left:10px;
  14.   width: 40px;
  15. }

Sponsored by:

ideenwerft webhosting
ideenwerft caretaker