Drupal: where can I get $ content Array in my topic?

I need to change the array of node content before rendering it in html. For this reason, I cannot use the $ content variable in my node template. I am looking for it in the template.php file, but I cannot find it.

thank

+3
source share
2 answers

AFAIK, you cannot access an undestructed array of node content from a topic, since the topic is processed until the end of the processing cycle (i.e. the content array will already be displayed, as you noticed).

node , hook_nodeapi() , . , , , , .

, - , , , , , .

+1

, , node: http://api.drupal.org/api/function/template_preprocess_node/6

, node template.php, , :

function phptemplate_preprocess_node(&$vars, $hook) {
   // Here you can add your custom variable...
   $vars['myContent'] = "something";
}
0

Source: https://habr.com/ru/post/1751961/


All Articles