1

a module that have an array,which value are $links[0]['text']="hello" and $links[2]['text']="world". could i overwrite them value by the mytheme_preprocess_node function in template.php. if can., how do i do?

1 Answer 1

1

You could only overwrite them if they are accessible within template_preprocess_node(). For example, if the module adds $links to the $vars (or $variables) array, or to the $node object, in its own implementation of preprocess_node(), you could simply do:

$vars['links'][0]['text'] = "i have changed this text";
If the module does not add $links to the $vars/$variables array or to the node object, you would not be able to change it from mytheme_preprocess_node().

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.