Please help!!!, I've stuck into the following problem:

Using the Views I need to generate a Drop-down list containg the Node titles of a certain content type as values. To go further, it will be needed to navigate the corresponding node's page when the corresponding item will be selected from this list.
any ideas?

thank you!

Comments

DLBaker’s picture

I got some code examples that might help you there:

function compression_product_leg_compression_product_bulk_options() {
$options = array();
$sizes = _compression_product_leg_sizes();

$options['size'] = array(
'type' => 'select',
'title' => 'Size',
'options' => _compression_product_map_descriptions($sizes),
);
$options['type'] = array(
'type' => 'select',
'title' => 'Type',
'options' => array(
'classic' => 'Classic',
'lite_tan' => 'Lite (tan)',
'lite_black' => 'Lite (black)',
),
);

return $options;
}

Does that help?

- Dan.

AnD-2’s picture

thank you Dan - unfortunately, not very clear to me... where this function needs to be inserted and how can I use instead of static array values, values generated by my View? Also how can I attache an event to this select which will redirect me to the corresponding Node's page?

DLBaker’s picture

Are you using the forms hook, hook_form?

From what I understand you should be able to create the drop downs through hook_form and form__alter. I am fairly new to this myself though.

- Dan.

WorldFallz’s picture

The only way I can think of to do this would be to setup an exposed filter for node title and form_alter it to be a select list instead of a text box. See http://drupal.org/node/463990 for some info.

AnD-2’s picture

thanks for this idea, howeverthe form_alter seems to be available only for D5....

I'm new to D and found it cool as well as it's Views, but I'm so much disapointed that having thouthands of modules and other helpers, nobody developed a simple solution which allows to represent the node titles generated by a View in a Drop-Down list - can't believe that nobody stuck into a similar problem...

The only idea I have at the moment - is to generate the nodes as a list into a hidden area of the page, and then to generate the drop-down list dinamically with jQuerry on page load. Doesn't look very elegant but I couldn't find something better

.... any other ideas?

WorldFallz’s picture

hook_form_alter is a drupal function and is most definitely available in d6.