Drupal: grab argument from node instead of url for block view? -


i have terms set node , block want grab arguments page page so:

http://site.com/node/22

but terms on page so:

term1

how can block grab term1 arg , show other nodes has term1?

you cannot grab data page php (without sort of complicated html tree parsing). instead, suggest getting term data node itself. consider following:

$node = node_load(arg(1)); // if you're on drupal 6: $terms = taxonomy_node_get_terms($node); // if drupal 7, terms should stored term reference field on node. $terms = field_get_items('node', $node, 'your term reference field');  foreach ($terms $term) {   // stuff here. } 

Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -