This sounds simple, but I just can’t get it…
I need to display a simple drop down list of the last 10 nodes of type X. I can’t seem to be able to create it with a simple view, it only lets me create static lists of nodes, and not drop down lists.
Thank you.
Ok first create a simple view with Row Style as fields and Style as unformatted. Use node title as a field and make sure HTML tags are stripped out. This should give you a list of node titles in plain text. These will be used as the options for the HTML select element.
Next we need to create a template to theme the output. You can do this by overriding the default view templates.
Click Information next to Theme: to show your template options. You want to theme the whole result set so we need to override the Style output (unformatted template). Next to style output is a list of template suggestions for this example I chose:
views-view-unformatted–drop-down-test.tpl.php
choose the suggestion after the bold one (this applies to all displays).
put this in the file:
`
`
Stick the file in your theme folder and click rescan template files and your template should get picked up and appear bold in the views interface.
Hit preview and now your results with be in a glorious drop down.