--=REKLAMA=--

Mod search searchword

Z Joomla!WikiPL

Opisywany element Selektor ID Selektor klasy Przyrostek
div mod_search_searchword
Szablony dla: Joomla 1.0, Joomla 1.5
Zastosowany w: modules/mod_related_items/tmpl/default.php
Stylizuje: pole tekstowe wyszukiwarki
#mod_search_searchword {}

Przeznaczenie

Unikalny identyfikator pola wyszukiwarki w module Szukaj.

Wykorzystany

W module Szukaj [mod_search]

Kod PHP

<?php // no direct access
defined('_JEXEC') or die('Restricted access'); ?>
<form action="index.php" method="post">
   <div class="search<?php echo $params->get('moduleclass_sfx') ?>">
      <?php
         $output = '<input name="searchword" id="mod_search_searchword" maxlength="'
         .$maxlength.'" alt="'.$button_text.'" class="inputbox'
         .$moduleclass_sfx.'" type="text" size="'.$width.'" value="'
         .$text.'"  onblur="if(this.value==\'\') this.value=\''
         .$text.'\';" onfocus="if(this.value==\''.$text.'\') this.value=\'\';" />';
 
         if ($button) :
            if ($imagebutton) :
               $button = '<input type="image" value="'.$button_text.'" class="button'
               .$moduleclass_sfx.'" src="'.$img.'" onclick="this.form.searchword.focus();"/>';
            else :
               $button = '<input type="submit" value="'.$button_text.'" class="button'
               .$moduleclass_sfx.'" onclick="this.form.searchword.focus();"/>';
	   endif;
         endif;
 
         switch ($button_pos) :
            case 'top' :
               $button = $button.'<br />';
               $output = $button.$output;
               break;
 
            case 'bottom' :
               $button = '<br />'.$button;
               $output = $output.$button;
               break;
 
            case 'right' :
               $output = $output.$button;
               break;
 
            case 'left' :
            default :
               $output = $button.$output;
               break;
         endswitch;
         echo $output;
         ?>
      </div>
      <input type="hidden" name="task"   value="search" />
      <input type="hidden" name="option" value="com_search" />
   </form>

Kod HTML

Przycisk tekstowy

<form action="index.php"  method="post" class="search">
   <label for="mod_search_searchword">Szukaj</label>
   <input type="submit" value="Szukaj" class="button"/>
   <input name="searchword" id="mod_search_searchword" maxlength="20" 
class="inputbox" type="text" size="20" 
value="Szukaj&hellip;"
onblur="if(this.value=='') this.value='Szukaj&hellip;';"
onfocus="if(this.value=='Szukaj&hellip;') this.value='';" />
   <input type="hidden" name="option" value="com_search" />
   <input type="hidden" name="task"   value="search" />
</form>

Przycisk z lewej strony

<form action="index.php"  method="post" class="search">
   <label for="mod_search_searchword">Szukaj	</label>
   <input type="image" value="Szukaj" class="button" src="/images/searchButton.gif"/>
   <input name="searchword" id="mod_search_searchword" maxlength="20" 
class="inputbox" type="text" size="20" 
value="Szukaj&hellip;"
onblur="if(this.value=='') this.value='Szukaj&hellip;';"
onfocus="if(this.value=='Szukaj&hellip;') this.value='';" />
   <input type="hidden" name="option" value="com_search" />
   <input type="hidden" name="task"   value="search" />
</form>


Przycisk z prawej strony

<form action="index.php"  method="post" class="search">
   <label for="mod_search_searchword">Szukaj</label>
   <input name="searchword" id="mod_search_searchword" maxlength="20" 
class="inputbox" type="text" size="20" 
value="Szukaj&hellip;"
onblur="if(this.value=='') this.value='Szukaj&hellip;';"
onfocus="if(this.value=='Szukaj&hellip;') this.value='';" />
   <input type="image" value="Szukaj" class="button" src="/images/searchButton.gif"/>
   <input type="hidden" name="option" value="com_search" />
   <input type="hidden" name="task"   value="search" />
</form>


Przycisk u góry

<form action="index.php"  method="post" class="search">
   <label for="mod_search_searchword">Szukaj</label>
   <input type="image" value="Szukaj" class="button" src="/images/searchButton.gif"/><br />
   <input name="searchword" id="mod_search_searchword" maxlength="20" 
class="inputbox" type="text" size="20" 
value="Szukaj&hellip;"
onblur="if(this.value=='') this.value='Szukaj&hellip;';"
onfocus="if(this.value=='Szukaj&hellip;') this.value='';" />
   <input type="hidden" name="option" value="com_search" />
   <input type="hidden" name="task"   value="search" />
</form>


Przycisk poniżej

<form action="index.php"  method="post" class="search">
   <label for="mod_search_searchword">Szukaj</label>
   <input name="searchword" id="mod_search_searchword" maxlength="20" 
class="inputbox" type="text" size="20" 
value="Szukaj&hellip;"
onblur="if(this.value=='') this.value='Szukaj&hellip;';"
onfocus="if(this.value=='Szukaj&hellip;') this.value='';" />
   <input type="hidden" name="option" value="com_search" />
   <input type="hidden" name="task"   value="search" /><br />
   <input type="image" value="Szukaj" class="button" src="/images/searchButton.gif"/>
   <input type="hidden" name="option" value="com_search" />
   <input type="hidden" name="task"   value="search" />

Przykładowy kod CSS


Wynik

Dziękujemy za wkład

» Stefan Wajda [zwiastun],