0

have searched google but cannot find anything specific . Intention is to get all Custom Node types that have been assigned a specific term of vocabulary . for example the follwoing is a db query to get custom node type.

$query->condition('type', "news_article")->fields('n',array('nid'))->orderBy('created', 'DESC')->range(0,90);

can the same query be modified to also add the filter for term id .

One other related question is that how can (in PHP) we get the term id from the url of the pattern e.g <drupal site>/taxonomy/term/2 .

any help appreciated

Abdul Ali
  • 1,905
  • 8
  • 28
  • 50
  • 1
    Are you looking for a list of node types or a list of nodes? For your second question, Drupal provides the `arg()` function to read the internal path (not aliased) of any page. For a taxonomy term page, the term id is `arg(2)`. – pamatt Jan 08 '14 at 18:07
  • thank you for the commemt. yes have used arg(2) for getting the term id – Abdul Ali Jan 08 '14 at 18:21

0 Answers0