Hello Drupal world,

I am new to using Drupal, and php, and i am using the taxonomy feature. What I would like to do is get an array of nodes/pages that have been marked with a specific term (something like $array_of_nodes = get_pages_with_term('term')). I hope to then manipulate to pages, so i can create text with titles & links within a block. I read through the tutorial on taxonomies, but can't find anything about writing a line of php like this.

Any help?

Comments

WorldFallz’s picture

You can do this with php/mysql of course, but you might want to take a look at the http://drupal.org/project/views module. Besides being able to handle the lists of nodes you want, it will show you the queries created to create them.

===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz

cmurockstar’s picture

Awesome, I am going to look at that right now... btw... do you know anything about:
taxonomy_select_nodes
from the Taxonomy API? Such as how to use it? Or an example of it in use? I don't quite get what the parameters are, and how/when to call it?

WorldFallz’s picture

I've not used that one, but I often find drupalcodesearch.com useful for finding examples.

===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz