Searchbox
am 26.05.2008 - 17:21 Uhr in
Hallo,
ist es möglich zu der Searchbox noch soetwas wie eine vorauswahl über ein Select-Menue zu machen?
Oder muss ich dazu eine komplett eigene/neue Box erstellen?
Gruss
drupalino
- Anmelden oder Registrieren um Kommentare zu schreiben

Auch hier keiner ne
am 27.05.2008 - 09:09 Uhr
Auch hier keiner ne Idee?
-------------------
gruss
drupalino
wie währs mit einem "select" block für taxonomie
am 27.05.2008 - 09:26 Uhr
<?php
$output = drupal_get_form('rubrik', $form);
return $output;
function rubrik() {
$formname="Rubrik selektieren";
$vid='(term_data.vid=2) or (term_data.vid=5) or (term_data.vid=6) ';
$order='term_data.vid';
$vocabulary = db_query("SELECT term_data.name, term_data.tid FROM term_data WHERE $vid ORDER BY $order");
$options[] = t($formname); // Initialise the country array
//Populate array with url / name
while ($term = db_fetch_object($vocabulary)) {
$options['index.php?q=taxonomy/term/'.$term->tid] = $term->name;
}
//Build dropdown select
//If we try to build OnChange directly it gets mangled, so put in array to confuse the forms api
$form['category'] = array(
'#type' => 'select',
'#name' => $formname,
'#id' => $formname,
'#title' => '',
'#default_value' => '',
'#options' => $options,
'#description' => '',
'#multiple' => $multiple = FALSE,
'#required' => $required = FALSE,
'#attributes' => array('onChange' => "top.location.href=document.getElementById('$formname').options[document.getElementById('$formname').selectedIndex].value"),
);
return $form;
}
?>
lg sofo
Wir Eltern in Europa
Eigentlich will ich nur ein
am 27.05.2008 - 20:29 Uhr
Eigentlich will ich nur ein selectmenü mit festen 3 Werten, die dann in dem query zu dem searchfield eingebaut werden.
-------------------
gruss
drupalino