Node title in dropdown

glennnz - January 1, 2009 - 23:24

Hi

I a trying to create a view where a user can select a node title from a dropdown list. The node titles in the list will be of a particular taxonomy term type.

The view will display information from the node that is selected.

How do I create this dropdown list? I am a complete newbie to Drupal and have no idea at all how to customise anything, so if you post a code answer, please tell me where to put the code snippet and how to use it.

Thanks

Glenn

RE:

ram_segal - January 4, 2009 - 14:23

Hey there,

Sounds like you can use the views module.

How to start:
add a new view to your page, add a filter (node title)

if you need further assistance, don't hesitate to ask.

Solved this with some PHP

glennnz - January 13, 2009 - 08:43

Solved this with some PHP coding.

Thanks

share your coding?

lsabug - April 6, 2009 - 20:06

Wondering how you did this without views. Thanks.

<form action="<?php echo

glennnz - April 6, 2009 - 22:07

<form action="<?php echo $PHP_SELF ?>" method="post">
    <select name="select_course_name"> <?php
$title
= db_query(db_rewrite_sql("SELECT title FROM {node} n WHERE type='course'"));
while (
$row = db_fetch_array($title)) {
 
$course_title = $row['title'];
  echo
"<option value='$course_title'>$course_title</option>";
}
?>
</select> <input type="submit" value="Submit" />
</form>

Glenn

Another module

danielb - April 7, 2009 - 06:30

Heres a module that can create a select list of titles (or an autocomplete of titles) to find the node.
http://drupal.org/project/autocomplete_node_finder

 
 

Drupal is a registered trademark of Dries Buytaert.